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 = '更新了备注 ';