diff --git a/app/adminapi/lists/TaskDetailLists.php b/app/adminapi/lists/TaskDetailLists.php index 877c9d6e0..09c135710 100644 --- a/app/adminapi/lists/TaskDetailLists.php +++ b/app/adminapi/lists/TaskDetailLists.php @@ -55,6 +55,7 @@ class TaskDetailLists extends BaseAdminDataLists implements ListsSearchInterface public function lists(): array { return TaskDetail::where($this->searchWhere) + ->with(['taskTypeInfo', 'taskAllocation']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() diff --git a/app/common/model/TaskDetail.php b/app/common/model/TaskDetail.php index 6a362dc3d..26445ddbe 100644 --- a/app/common/model/TaskDetail.php +++ b/app/common/model/TaskDetail.php @@ -16,6 +16,7 @@ namespace app\common\model; use app\common\model\BaseModel; +use app\common\model\task\TaskType; use think\model\concern\SoftDelete; @@ -30,5 +31,13 @@ class TaskDetail extends BaseModel protected $name = 'task_detail'; protected $deleteTime = 'delete_time'; - + public function taskTypeInfo() + { + return $this->hasOne(TaskType::class, 'id', 'task_type_id'); + } + + public function taskAllocation() + { + return $this->hasOne(TaskType::class, 'id', 'task_allocation_id'); + } } \ No newline at end of file