Sfoglia il codice sorgente

修改撤消出金

Robin 6 anni fa
parent
commit
883681507f

+ 9 - 3
normandcrm/service/backend/controllers/WithdrawController.php

@@ -373,11 +373,17 @@ class WithdrawController extends BaseController
             //调用mt4的撤销出金接口
              $api = new Mt4ManagerApi();
              $result = $api->revokeOrder($mt4_id);
+             if(empty($result)){
+                 return $this->outJson(0, [], '更新失败');
+             }
              $result = json_decode($result,true);
              $tt = print_r($result,true);
              file_put_contents('mt1.txt',$tt);
              if(!$result['ret']){
                  $result2 = $api->fixbalance($login);
+                 if(empty($result2)){
+                     return $this->outJson(0, [], '更新失败');
+                 }
                  $res2 = json_decode($result2,true);
                  $tt = print_r($res2,true);
                  file_put_contents('mt2.txt',$tt);
@@ -386,15 +392,15 @@ class WithdrawController extends BaseController
                      if($res3){
                          return $this->outJson(1, [], '操作成功');
                      }else{
-                         return $this->outJson(0, [], 'fixbalance失败');
+                         return $this->outJson(0, [], '更新失败');
                      }
                  }
              }else{
-                 return $this->outJson(0, [], 'mt4操作失败');
+                 return $this->outJson(0, [], '更新失败');
              }
 
         }else{
-            return $this->outJson(0, [], '更新操作失败');
+            return $this->outJson(0, [], '更新失败');
         }
     }
 

+ 2 - 2
normandcrm/service/common/lib/Mt4ManagerApi.php

@@ -118,7 +118,7 @@ class Mt4ManagerApi
         );
         $config = Config::findOne(1);                   //获取到配置文件
         $mt4_pay_ip = $config['mt4_pay_ip'];                     //获取mt4出入金ip
-        $mt4_pay_port = 10001;                 //获取出入金端口
+        $mt4_pay_port = $config['mt4_pay_port'];                 //获取出入金端口
         $this->url = "http://{$mt4_pay_ip}:{$mt4_pay_port}/api";
         return $this->_httpRequest($this->url, $params);
     }
@@ -131,7 +131,7 @@ class Mt4ManagerApi
         );
         $config = Config::findOne(1);                   //获取到配置文件
         $mt4_pay_ip = $config['mt4_pay_ip'];                     //获取mt4出入金ip
-        $mt4_pay_port = 10001;                 //获取出入金端口
+        $mt4_pay_port = $config['mt4_pay_port'];               //获取出入金端口
         $this->url = "http://{$mt4_pay_ip}:{$mt4_pay_port}/api";
         return $this->_httpRequest($this->url, $params);
     }