evoxwht пре 2 година
родитељ
комит
f3b3f38e13

+ 12 - 7
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)
     {

+ 1 - 1
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);
         }
     }
 

+ 1 - 3
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;
     }
 
     /**