From 31961f5727bf208b3d7724227e191991cdd5b229 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 15 Nov 2023 15:18:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8F=90=E7=8E=B0=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/finance/WithdrawLogic.php | 2 +- app/middleapi/controller/WithdrawController.php | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/common/logic/finance/WithdrawLogic.php b/app/common/logic/finance/WithdrawLogic.php index f92dfc349..3c5564f0e 100644 --- a/app/common/logic/finance/WithdrawLogic.php +++ b/app/common/logic/finance/WithdrawLogic.php @@ -44,7 +44,7 @@ class WithdrawLogic extends BaseLogic // 拒绝通过审核,记录备注原因 if ($params['status'] == 2) { - Withdraw::where(['id'=>$withDrawInfo['id']])->update(['status'=>2, 'deny_desc'=>$params['deny_desc']]); + Withdraw::where(['id'=>$withDrawInfo['id']])->update(['status'=>2, 'deny_desc'=>$params['deny_desc'] ?? '']); return true; } diff --git a/app/middleapi/controller/WithdrawController.php b/app/middleapi/controller/WithdrawController.php index f66f7325b..20c7e4490 100644 --- a/app/middleapi/controller/WithdrawController.php +++ b/app/middleapi/controller/WithdrawController.php @@ -61,11 +61,15 @@ class WithdrawController extends BaseLikeAdminController return $this->success('请求成功',$result); } - public function update($id) + public function update() { + $id = $this->request->param('id'); $status = $this->request->param('status'); + if (empty($id)) { + return $this->fail('参数id不能为空'); + } if (!in_array($status, [1, 2, 3])) { - return $this->fail('参数错误'); + return $this->fail('参数status错误'); } $data = Withdraw::find($id); if (empty($data)) { @@ -84,6 +88,12 @@ class WithdrawController extends BaseLikeAdminController { try { $params = $this->request->param(); + if (empty($params['id'])) { + return $this->fail('参数id不能为空'); + } + if (empty($params['status'])) { + return $this->fail('参数status不能为空'); + } $re = WithdrawLogic::audit($params); if (!$re) { return $this->fail(WithdrawLogic::getError());