From 9b3771af8a668aa2861b56270cfa9a424f4350de Mon Sep 17 00:00:00 2001
From: chenbo <709206448@qq.com>
Date: Tue, 27 Feb 2024 14:15:07 +0800
Subject: [PATCH] update

---
 app/adminapi/lists/TaskDetailLists.php |  1 +
 app/common/model/TaskDetail.php        | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

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