From de38de71387916b3a90ee4501851b8a4543a016e Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 14 Sep 2023 10:46:48 +0800 Subject: [PATCH] =?UTF-8?q?add:=E5=85=B6=E4=BB=96=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/TaskController.php | 25 +++++++++++++++++++++++++ app/common/logic/task/TaskLogic.php | 12 ++++++++++++ 2 files changed, 37 insertions(+) diff --git a/app/api/controller/TaskController.php b/app/api/controller/TaskController.php index 07a2fc587..94121f8fc 100644 --- a/app/api/controller/TaskController.php +++ b/app/api/controller/TaskController.php @@ -202,4 +202,29 @@ class TaskController extends BaseApiController } return $this->success('ok', $list); } + + /** + * 其他任务详情 + */ + public function other_task_detail(){ + $parmas = $this->request->param(); + $task = TaskLogic::detail($parmas); + return $this->success('ok', $task); + } + + /** + * 其他任务 -提交 + */ + public function cimmit_other_tast() + { + $parmas = $this->request->param(); //id note annex + $task = TaskLogic::detail($parmas); + if (empty($task)) { + $this->fail('任务不存在'); + } + $extend = ['other' => ['is_commit' => 1, 'note' => $parmas['note'], 'annex'=>$parmas['annex']]]; + Task::where(['id' => $parmas['id']])->update(['extend' => json_encode($extend)]); + return $this->success('ok', []); + } + } diff --git a/app/common/logic/task/TaskLogic.php b/app/common/logic/task/TaskLogic.php index aeb0bc5ae..bacb2895c 100644 --- a/app/common/logic/task/TaskLogic.php +++ b/app/common/logic/task/TaskLogic.php @@ -174,6 +174,18 @@ class TaskLogic extends BaseLogic ]; $data['extend'] = json_encode($extend); } + // 其他任务 + if ($v['type'] == 34) { + // is_commit 是否提交 note 详情描述 annex 附件 + $extend = [ + 'other'=> [ + 'is_commit' => 0, + 'note' => '', + 'annex' => '' + ] + ]; + $data['extend'] = json_encode($extend); + } $task_id = (new Task())->insertGetId($data); TaskSchedulingPlan::where('id', $TaskSchedulingPlan['id'])->update(['task_id' => $task_id, 'is_execute' => 1]); TaskTemplate::where('id', $v['id'])->inc('day_count')->update();