dataLists(new ContractLists()); } /** * @notes 添加 * @return \think\response\Json * @author likeadmin * @date 2023/07/18 14:28 */ public function add() { $params = (new ContractValidate())->post()->goCheck('add'); $result = ContractLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(ContractLogic::getError()); } /** * @notes 编辑 * @return \think\response\Json * @author likeadmin * @date 2023/07/18 14:28 */ public function edit() { $params = (new ContractValidate())->post()->goCheck('edit'); $result = ContractLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(ContractLogic::getError()); } /** * @notes 删除 * @return \think\response\Json * @author likeadmin * @date 2023/07/18 14:28 */ public function delete() { $params = (new ContractValidate())->post()->goCheck('delete'); ContractLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取详情 * @return \think\response\Json * @author likeadmin * @date 2023/07/18 14:28 */ public function detail() { $params = (new ContractValidate())->goCheck('detail'); $result = ContractLogic::detail($params); return $this->data($result); } //风控部上传合同 public function wind_control() { $params = Request::param(); $file = $params['file']; $res = Contract::where('id', $params['id'])->update(['file' => $file]); if ($res) { return $this->success('上传成功', [], 1, 1); } else { return $this->fail('上传失败'); } } }