|
|
|
@ -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']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|