// +---------------------------------------------------------------------- declare (strict_types=1); namespace app\common\model; use cores\BaseModel; use think\model\relation\BelongsTo; /** * 文件库分组模型 * Class UploadGroup * @package app\common\model */ class Maintenance extends BaseModel { // 定义表名 protected $name = 'maintenance'; public static function detail(int $articleId, array $with = []) { return self::get($articleId, $with); } public function category(): BelongsTo { $module = self::getCalledModule(); return $this->BelongsTo("app\\{$module}\\model\\MaintenanceCategory", 'category_id'); } }