Browse Source

Merge branch 'main' of http://124.222.171.90:10880/Southeast-Asia/API-Tou-Biao

afa 1 year ago
parent
commit
5ca4ef28f0
2 changed files with 15 additions and 7 deletions
  1. 14 6
      application/api/controller/Money.php
  2. 1 1
      application/common/model/Users.php

+ 14 - 6
application/api/controller/Money.php

@@ -203,18 +203,26 @@ class Money extends Api
         $data['usdt']['is_open'] = $withdraw_info['usdt'];
         $data['bank']['is_open'] = $withdraw_info['bank'];
 
+        if($withdraw_info['usdt'] == 0 && $withdraw_info['bank'] == 0){
+            $this->error(__('无提现信息'));
+        }
+
+        if(empty($user['usdt_address'] && empty($user['bank_info']){
+            $this->error(__('出款信息未配置'), '', 4002);
+        }
+
         if($withdraw_info['usdt']){
-            if(empty($user['usdt_address'])){
-                $this->error(__('出款信息未配置'), '', 4002);
-            }
+//            if(empty($user['usdt_address'])){
+//                $this->error(__('出款信息未配置'), '', 4002);
+//            }
 
             $data['usdt']['address'] = $user['usdt_address'];
         }
 
         if($withdraw_info['bank']){
-            if(empty($user['bank_info'])){
-                $this->error(__('出款信息未配置'), '', 4002);
-            }
+//            if(empty($user['bank_info'])){
+//                $this->error(__('出款信息未配置'), '', 4002);
+//            }
             $data['bank']['account_name'] = $data['bank']['bank_name'] = $data['bank']['bank_card'] = '';
             $bank_info = json_decode($user['bank_info'], true);
             if(!empty($bank_info)){

+ 1 - 1
application/common/model/Users.php

@@ -62,7 +62,7 @@ class Users extends Model
                 ->where('is_lock', 0)
                 ->where('is_delete', 0)
                 ->find();
-            $data['agent_id'] = $parent_info['agent_id'];
+            $data['agent_id'] = $parent_info['agent_id'] ?? 0;
         }
         $info = self::where('id', $data['agent_id'])
             ->where('is_agent', 1)