lip 19 小時之前
父節點
當前提交
e4fba83c55
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 1 1
      app/Http/Controllers/api/Wallet.php
  2. 2 0
      app/Services/QianBaoWithdrawService.php

+ 1 - 1
app/Http/Controllers/api/Wallet.php

@@ -169,7 +169,7 @@ class Wallet extends BaseController
             ]);
             $member_id = request()->user->member_id;
             $res = QianBaoWithdrawService::createOrder($member_id, $params['amount'], $params['channel'], $params['bank_name'], $params['account'], $params['card_no']);
-            if (empty($res['text'])) { 
+            if ($res['code'] == 0) { 
                 return $this->success($res,'提交成功');
             }
             return $this->error($res['text']);

+ 2 - 0
app/Services/QianBaoWithdrawService.php

@@ -442,6 +442,7 @@ class QianBaoWithdrawService
     {
         DB::beginTransaction();
         $result['chat_id'] = $memberId;
+        $result['code'] = 0;
         $default_amount = $amount;
         try {
             $wallet = WalletService::findOne(['member_id' => $memberId]);
@@ -488,6 +489,7 @@ class QianBaoWithdrawService
             DB::rollBack();
             LogService::error($e);
             $result['text'] = "系统发生了错误,请联系管理员";
+            $result['code'] = -1;
             if ($e->getCode() === HttpStatus::CUSTOM_ERROR) {
                 $result['text'] = $e->getMessage();
             }