add:其他任务详情接口,提交任务接口

This commit is contained in:
chenbo 2023-09-14 10:46:48 +08:00
parent d131e34663
commit de38de7138
2 changed files with 37 additions and 0 deletions

View File

@ -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', []);
}
}

View File

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