This commit is contained in:
chenbo 2023-09-19 11:37:44 +08:00
parent 6ba04b1b2c
commit 235b63636a
2 changed files with 5 additions and 2 deletions

View File

@ -43,6 +43,9 @@ class ApproveController extends BaseApiController
{ {
$param = $this->request->param(); $param = $this->request->param();
$detail = ApproveLogic::detail($param['id']); $detail = ApproveLogic::detail($param['id']);
return $this->success('成功', $detail); if (!$detail) {
$this->fail('数据不存在');
}
return $this->success('成功', $detail->toArray());
} }
} }

View File

@ -54,6 +54,6 @@ class ApproveLogic extends BaseLogic
public static function detail($id) public static function detail($id)
{ {
return Approve::where(['id', $id])->find(); return Approve::find($id);
} }
} }