dataLists(new SubcontractingContractLists()); } /** * @notes 添加 * @return \think\response\Json * @author likeadmin * @date 2023/12/12 17:15 */ public function add() { $params = (new SubcontractingContractValidate())->post()->goCheck('add'); $result = SubcontractingContractLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(SubcontractingContractLogic::getError()); } /** * @notes 编辑 * @return \think\response\Json * @author likeadmin * @date 2023/12/12 17:15 */ public function edit() { $params = (new SubcontractingContractValidate())->post()->goCheck('edit'); $result = SubcontractingContractLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(SubcontractingContractLogic::getError()); } /** * @notes 获取详情 * @return \think\response\Json * @author likeadmin * @date 2023/12/12 17:15 */ public function detail() { $params = (new SubcontractingContractValidate())->goCheck('detail'); $result = SubcontractingContractLogic::detail($params); return $this->data($result); } public function flows(): \think\response\Json { $flow_type = FlowType::where('type',2)->where('name','fbht')->findOrEmpty(); $data = Flow::field('id,name')->where('flow_cate',$flow_type['id'])->where('status',2)->select(); return $this->success('请求成功',$data->toArray()); } //添加审批 public function approve(): \think\response\Json { $params = (new SubcontractingContractValidate())->post()->goCheck('approve'); $result = SubcontractingContractLogic::approve($params,$this->adminId); if (true === $result) { return $this->success('提交审核信息成功', [], 1, 1); } return $this->fail(SubcontractingContractLogic::getError()); } }