dataLists(new TaskLists()); } /** * @notes 添加任务 * @return \think\response\Json * @author likeadmin * @date 2023/08/05 13:39 */ public function add() { $params = (new TaskValidate())->post()->goCheck('add'); if($params['type']==1){ $arr=[42,43,44,45];//信息更新 $params['extend']['informationg']['arr']=$arr; $params['extend']['informationg']['arr_count']=count($arr); $params['extend']['informationg']['update']=[]; $params['extend']['informationg']['update_count']=0; } $result = TaskLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(TaskLogic::getError()); } public function CronAdd(){ $all=TaskSchedulingPlan::whereDay('start_time')->with(['template_info','scheduling'])->select(); $res=TaskLogic::CronAdd($all->toArray()); if($res){ return $this->success('添加成功', [], 1, 1); } return $this->fail(TaskLogic::getError()); } /** * @notes 编辑任务 * @return \think\response\Json * @author likeadmin * @date 2023/08/05 13:39 */ public function edit() { $params = (new TaskValidate())->post()->goCheck('edit'); $result = TaskLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(TaskLogic::getError()); } /** * @notes 删除任务 * @return \think\response\Json * @author likeadmin * @date 2023/08/05 13:39 */ public function delete() { $params = (new TaskValidate())->post()->goCheck('delete'); TaskLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取任务详情 * @return \think\response\Json * @author likeadmin * @date 2023/08/05 13:39 */ public function detail() { $params = (new TaskValidate())->goCheck('detail'); $result = TaskLogic::detail($params); return $this->data($result); } }