diff --git a/app/middleapi/controller/DictDataController.php b/app/middleapi/controller/DictDataController.php new file mode 100644 index 000000000..c1272d010 --- /dev/null +++ b/app/middleapi/controller/DictDataController.php @@ -0,0 +1,70 @@ +request->isPost()){ + return $this->fail('请求方式错误'); + } + $params=$this->request->post(['page_no','page_size','name','type_id','type_value']); + $where = []; + if(!empty($params['name'])){ + $where[] = ['name','like','%' . $params['name'] . '%']; + } + if(!empty($params['type_id'])){ + $where[] = ['type_id', '=', $params['type_id']]; + } + if(!empty($params['type_value'])){ + $where[] = ['type_value', '=', $params['type_value']]; + } + $pageNo = !empty($params['page_no']) ? $params['page_no'] : 1; + $pageSize = !empty($params['page_size']) ? $params['page_size'] : 20; + $data = DictData::where($where) + ->append(['status_desc']) + ->page($pageNo, $pageSize) + ->order(['sort' => 'desc', 'id' => 'desc']) + ->select() + ->toArray(); + $count = DictData::where($where)->count(); + $result = [ + 'lists' => $data, + 'count' => $count, + 'page_no' => $pageNo, + 'page_size' => $pageSize + ]; + return $this->success('请求成功',$result); + } + + /** + * @notes 获取字典详情 + * @return \think\response\Json + * @author 段誉 + * @date 2022/6/20 17:14 + */ + public function detail() + { + $params = (new DictDataValidate())->goCheck('id'); + $result = DictDataLogic::detail($params); + return $this->data($result); + } + +} \ No newline at end of file diff --git a/app/middleapi/controller/TaskSchedulingController.php b/app/middleapi/controller/TaskSchedulingController.php new file mode 100644 index 000000000..6a457418c --- /dev/null +++ b/app/middleapi/controller/TaskSchedulingController.php @@ -0,0 +1,132 @@ +request->isPost()){ + return $this->fail('请求方式错误'); + } + $params=$this->request->post(['page_no','page_size','company_id']); + $where = []; + if (isset($params['company_id']) && $params['company_id'] != '') { + $arr = Company::where('company_name', 'like', '%' . $params['company_id'] . '%')->column('id'); + if ($arr) { + $where[] = ['company_id', 'in', $arr]; + } else { + $where[] = ['company_id', 'in', [0]]; + } + } + $pageNo = !empty($params['page_no']) ? $params['page_no'] : 1; + $pageSize = !empty($params['page_size']) ? $params['page_size'] : 20; + $data = TaskScheduling::where($where) + ->with(['admin', 'company', 'company_type']) + ->page($pageNo, $pageSize) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + $count = TaskScheduling::where($where)->count(); + $result = [ + 'lists' => $data, + 'count' => $count, + 'page_no' => $pageNo, + 'page_size' => $pageSize + ]; + return $this->success('请求成功',$result); + } + + + /** + * @notes 添加任务公司排期 + * @return \think\response\Json + * @author likeadmin + * @date 2023/08/08 10:08 + */ + public function add() + { + return $this->fail('暂未开放'); + $params = (new TaskSchedulingValidate())->post()->goCheck('add'); + $params['create_user_id']=$this->adminId; + $result = TaskSchedulingLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(TaskSchedulingLogic::getError()); + } + + + /** + * @notes 编辑任务公司排期 + * @return \think\response\Json + * @author likeadmin + * @date 2023/08/08 10:08 + */ + public function edit() + { + $params = (new TaskSchedulingValidate())->post()->goCheck('edit'); + $result = TaskSchedulingLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(TaskSchedulingLogic::getError()); + } + //编辑金额 + public function editMoney() + { + $params = $this->request->param(); + $moeny=$params['money']; + $result = TaskScheduling::where(['id'=>$params['id']])->update(['money'=>$moeny]); + if ( $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail('编辑失败'); + } + + /** + * @notes 删除任务公司排期 + * @return \think\response\Json + * @author likeadmin + * @date 2023/08/08 10:08 + */ + public function delete() + { + $params = (new TaskSchedulingValidate())->post()->goCheck('delete'); + TaskSchedulingLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取任务公司排期详情 + * @return \think\response\Json + * @author likeadmin + * @date 2023/08/08 10:08 + */ + public function detail() + { + $params = (new TaskSchedulingValidate())->goCheck('detail'); + $result = TaskSchedulingLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file