|
|
|
@ -14,6 +14,7 @@ namespace app\common\model; |
|
|
|
|
|
|
|
|
|
use cores\BaseModel; |
|
|
|
|
use think\model\relation\BelongsTo; |
|
|
|
|
use think\model\relation\HasOne; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 文件库分组模型 |
|
|
|
@ -36,4 +37,11 @@ class Maintenance extends BaseModel |
|
|
|
|
$module = self::getCalledModule(); |
|
|
|
|
return $this->BelongsTo("app\\{$module}\\model\\MaintenanceCategory", 'category_id'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function catImg(): HasOne |
|
|
|
|
{ |
|
|
|
|
$module = self::getCalledModule(); |
|
|
|
|
return $this->hasOne("app\\{$module}\\model\\UploadFile", 'file_id', 'img_id') |
|
|
|
|
->bind(['img_url' => 'preview_url']); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|