From f3b3f38e13c77a4d5806b4c0dfa9f9c1cc618034 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 29 Mar 2023 10:57:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=8E=B0=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/services/user/UserExtractServices.php | 19 ++++++++++++------- crmeb/crmeb/services/app/WechatService.php | 2 +- .../services/pay/storage/V3WechatPay.php | 4 +--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/crmeb/app/services/user/UserExtractServices.php b/crmeb/app/services/user/UserExtractServices.php index d8b330c0f..8e847b24c 100644 --- a/crmeb/app/services/user/UserExtractServices.php +++ b/crmeb/app/services/user/UserExtractServices.php @@ -148,11 +148,12 @@ class UserExtractServices extends BaseServices /** * 通过提现申请 - * @param $id + * @param int $id + * @param $userExtract * @return bool * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException - * @throws \think\exception\DbException */ public function changeSuccess(int $id, $userExtract) { @@ -164,11 +165,7 @@ class UserExtractServices extends BaseServices $userType = $userServices->value(['uid' => $userExtract['uid']], 'user_type'); $nickname = $userServices->value(['uid' => $userExtract['uid']], 'nickname'); $phone = $userServices->value(['uid' => $userExtract['uid']], 'phone'); - event('NoticeListener', [['uid' => $userExtract['uid'], 'userType' => strtolower($userType), 'extractNumber' => $extractNumber, 'nickname' => $nickname], 'user_extract']); - if (!$this->dao->update($id, ['status' => 1])) { - throw new AdminException(100007); - } switch ($userExtract['extract_type']) { case 'bank': $order_id = $userExtract['bank_code']; @@ -246,6 +243,12 @@ class UserExtractServices extends BaseServices 'nickname' => $insertData['nickname'], 'phone' => $insertData['phone'] ], 'extract'); + + if (!$this->dao->update($id, ['status' => 1])) { + throw new AdminException(100007); + } + event('NoticeListener', [['uid' => $userExtract['uid'], 'userType' => strtolower($userType), 'extractNumber' => $extractNumber, 'nickname' => $nickname], 'user_extract']); + return true; } @@ -339,8 +342,10 @@ class UserExtractServices extends BaseServices /** * 通过 - * @param $id + * @param int $id * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\ModelNotFoundException */ public function adopt(int $id) { diff --git a/crmeb/crmeb/services/app/WechatService.php b/crmeb/crmeb/services/app/WechatService.php index 41c9e47bc..24fad4bbc 100644 --- a/crmeb/crmeb/services/app/WechatService.php +++ b/crmeb/crmeb/services/app/WechatService.php @@ -392,7 +392,7 @@ class WechatService if ($result->return_code == 'SUCCESS' && $result->result_code != 'FAIL') { return true; } else { - throw new ApiException(410089); + throw new ApiException($result->err_code_des ?? 400658); } } diff --git a/crmeb/crmeb/services/pay/storage/V3WechatPay.php b/crmeb/crmeb/services/pay/storage/V3WechatPay.php index c384d2bc6..fa8399ec2 100644 --- a/crmeb/crmeb/services/pay/storage/V3WechatPay.php +++ b/crmeb/crmeb/services/pay/storage/V3WechatPay.php @@ -146,7 +146,7 @@ class V3WechatPay extends BasePay implements PayInterface */ public function merchantPay(string $openid, string $orderId, string $amount, array $options = []) { - $res = $this->instance->v3pay->setType($options['type'])->batches( + return $this->instance->v3pay->setType($options['type'])->batches( $orderId, $amount, $options['batch_name'], @@ -160,8 +160,6 @@ class V3WechatPay extends BasePay implements PayInterface ] ] ); - - return $res; } /**