dataLists(new ApproveLists()); } public function approveType() { $list = Db::name('flow_type')->where(['status' => 1])->field(['id, title'])->select()->toArray(); return $this->success('成功', $list); } /** * 前台通用审批接口 审批后的业务逻辑,需要具体拆解 */ public function audit() { try { $params = $this->request->param(); // id check_status remark $approve = Approve::find($params['id']); if (!$approve) { throw new Exception('数据不存在'); } ApproveLogic::audit($approve, $params, $this->userInfo); return $this->success('操作成功'); } catch (Exception $exception) { return $this->fail(ApproveLogic::getError() ?? $exception->getMessage()); } } public function detail() { $param = $this->request->param(); $detail = ApproveLogic::detail($param['id']); if (!$detail) { $this->fail('数据不存在'); } return $this->success('成功', $detail->toArray()); } }