Quellcode durchsuchen

撤销出金订单

Robin vor 6 Jahren
Ursprung
Commit
50aae15957

+ 0 - 1
normandcrm/admin/backend/modules/admin/views/withdraw/index.php

@@ -567,7 +567,6 @@ use yii\helpers\Url;
                 closeOnConfirm: true
                 closeOnConfirm: true
             }, function (isConfirm) {
             }, function (isConfirm) {
                 if (isConfirm) {
                 if (isConfirm) {
-                    console.log(data);
                     $.ajax({
                     $.ajax({
                         type: "POST",
                         type: "POST",
                         url: "<?= Url::to(['revokegold']) ?>",
                         url: "<?= Url::to(['revokegold']) ?>",

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

@@ -368,11 +368,16 @@ class WithdrawController extends BaseController
         if($res){
         if($res){
 
 
             //调用mt4的撤销出金接口
             //调用mt4的撤销出金接口
-            // $api = new Mt4ManagerApi();
-            // $api->userUpdate($mt4_id);
-            return $this->outJson(1, [], '操作成功');
+             $api = new Mt4ManagerApi();
+             $result = $api->revokeOrder($mt4_id);
+             if(!$result){
+                 return $this->outJson(1, [], '操作成功');
+             }else{
+                 return $this->outJson(0, [], 'mt4操作失败');
+             }
+
         }else{
         }else{
-            return $this->outJson(0, [], '操作失败'); 
+            return $this->outJson(0, [], '更新操作失败');
         }
         }
 
 
 
 

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

@@ -82,7 +82,7 @@ class Mt4ManagerApi
         $data['login'] = trim($login);
         $data['login'] = trim($login);
 		
 		
 		
 		
-		$config = Config::findOne(1);                            //获取到配置文件
+		$config = Config::findOne(1);                   //获取到配置文件
         $mt4_pay_ip = $config['mt4_pay_ip'];                     //获取mt4出入金ip
         $mt4_pay_ip = $config['mt4_pay_ip'];                     //获取mt4出入金ip
         $mt4_pay_port = $config['mt4_pay_port'];                 //获取出入金端口
         $mt4_pay_port = $config['mt4_pay_port'];                 //获取出入金端口
         $this->url = "http://{$mt4_pay_ip}:{$mt4_pay_port}/api";
         $this->url = "http://{$mt4_pay_ip}:{$mt4_pay_port}/api";
@@ -100,7 +100,24 @@ class Mt4ManagerApi
             'login' => trim($login),
             'login' => trim($login),
             'password' => trim($password),
             'password' => trim($password),
         );
         );
-        $config = Config::findOne(1);                            //获取到配置文件
+        $config = Config::findOne(1);                   //获取到配置文件
+        $mt4_pay_ip = $config['mt4_pay_ip'];                     //获取mt4出入金ip
+        $mt4_pay_port = $config['mt4_pay_port'];                 //获取出入金端口
+        $this->url = "http://{$mt4_pay_ip}:{$mt4_pay_port}/api";
+
+        return $this->_httpRequest($this->url, $params);
+    }
+
+    /*
+     * 删除mt4订单
+     */
+    public function revokeOrder($orders)
+    {
+        $params = array(
+            'cmd' => 'deleteorders',
+            'orders' => trim($orders),
+        );
+        $config = Config::findOne(1);                   //获取到配置文件
         $mt4_pay_ip = $config['mt4_pay_ip'];                     //获取mt4出入金ip
         $mt4_pay_ip = $config['mt4_pay_ip'];                     //获取mt4出入金ip
         $mt4_pay_port = $config['mt4_pay_port'];                 //获取出入金端口
         $mt4_pay_port = $config['mt4_pay_port'];                 //获取出入金端口
         $this->url = "http://{$mt4_pay_ip}:{$mt4_pay_port}/api";
         $this->url = "http://{$mt4_pay_ip}:{$mt4_pay_port}/api";