增加文章分类图片

pull/1/head
limu 1 year ago
parent cfe9dd03a2
commit b5dd413388
  1. 3
      app/common/model/article/Category.php

@ -44,7 +44,8 @@ class Category extends BaseModel
*/
public function catImg(): HasOne
{
return $this->hasOne('UploadFile', 'file_id', 'img_id')
$module = self::getCalledModule();
return $this->hasOne("app\\{$module}\\model\\UploadFile", 'file_id', 'img_id')
->bind(['img_url' => 'preview_url']);
}

Loading…
Cancel
Save