From 53ad9f0c0c3b192d3dcc967e08035f425cdec289 Mon Sep 17 00:00:00 2001 From: vilson <545522390@qq.com> Date: Sun, 23 Jun 2019 22:44:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=BB=E5=8A=A1=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: vilson <545522390@qq.com> --- application/common/Model/Task.php | 8 ++++++++ application/project/behavior/Task.php | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/application/common/Model/Task.php b/application/common/Model/Task.php index cfc7fd2..d4b150a 100644 --- a/application/common/Model/Task.php +++ b/application/common/Model/Task.php @@ -425,6 +425,9 @@ class Task extends CommonModel * @param $stageCode string 移到的任务列表code * @param $codes array 经过排序的任务code列表 * @return bool + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException */ public function sort($stageCode, $codes) { @@ -432,8 +435,13 @@ class Task extends CommonModel return false; } if ($codes) { + $stage = TaskStages::where(['code' => $stageCode])->find(); foreach ($codes as $key => $code) { + $task = self::where(['code' => $code])->find(); self::update(['sort' => $key, 'stage_code' => $stageCode], ['code' => $code]); + if ($task['stage_code'] != $stageCode) { + self::taskHook(getCurrentMember()['code'], $code, 'move', '', '', '', '', '', ['stageName' => $stage['name']]); + } } return true; } diff --git a/application/project/behavior/Task.php b/application/project/behavior/Task.php index 0caf143..037dcbf 100644 --- a/application/project/behavior/Task.php +++ b/application/project/behavior/Task.php @@ -57,6 +57,11 @@ class Task $remark = '更新了内容 '; $content = $task['name']; break; + case 'move': + $icon = 'drag'; + $remark = '将任务移动到 ' . $data['data']['stageName']; + $content = $task['name']; + break; case 'content': $icon = 'file-text'; $remark = '更新了备注 ';