From e02627e55849f3543e0856a4ceedc9bf75d78825 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 6 Jan 2024 14:11:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/Model/Task.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/application/common/Model/Task.php b/application/common/Model/Task.php index 3344f18..d855603 100755 --- a/application/common/Model/Task.php +++ b/application/common/Model/Task.php @@ -26,7 +26,7 @@ class Task extends CommonModel if (!$code) { throw new Exception('请选择任务', 1); } - $task = self::where(['code' => $code])->field('id', true)->find(); + $task = self::where(['code' => $code])->field('id', true)->find()->toArray(); if (!$task) { throw new Exception('该任务已失效', 404); } @@ -36,6 +36,16 @@ class Task extends CommonModel if ($task['assign_to']) { $task['executor'] = Member::where(['code' => $task['assign_to']])->field('name,code,avatar')->find(); } + $exchange_list=explode(',',$task['exchange_list']); + $copied_list=explode(',',$task['copied_list']); + $task['exchange_info']=null; + $task['copied_info']=null; + foreach($exchange_list as $k=>$v){ + $task['exchange_info'][]=Member::where(['code'=>$v])->field('name,code,avatar')->find(); + } + foreach($copied_list as $k=>$v){ + $task['copied_info'][]=Member::where(['code'=>$v])->field('name,code,avatar')->find(); + } if ($task['pcode']) { $task['parentTask'] = self::where(['code' => $task['pcode']])->field('id', true)->find(); $parents = [];