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();