|
|
@@ -365,20 +365,28 @@ class WithdrawController extends BaseController
|
|
|
public function actionRevokegold(){
|
|
|
$id = (int) Yii::$app->request->post('id');
|
|
|
$mt4_id = (int) Yii::$app->request->post('mt4_id');
|
|
|
+ $login = Withdraw::findOne($id)['login'];
|
|
|
$res = Withdraw::updateAll(['type' => 1], "id = $id"); //更新出金表的状态(不通过,未扣减)
|
|
|
|
|
|
if($res){
|
|
|
//调用mt4的撤销出金接口
|
|
|
$api = new Mt4ManagerApi();
|
|
|
$result = $api->revokeOrder($mt4_id);
|
|
|
- $tt = print_r($result,true);
|
|
|
$result = json_decode($result,true);
|
|
|
-
|
|
|
- file_put_contents('mt4_witt.txt',$tt);
|
|
|
+ $tt = print_r($result,true);
|
|
|
+ file_put_contents('mt1.txt',$tt);
|
|
|
if(!$result['ret']){
|
|
|
- $res1 = Withdraw::updateAll(['mt4_status' => 0], "id = $id"); //更新出金表的状态(mt4未扣减)
|
|
|
- if($res1){
|
|
|
- return $this->outJson(1, [], '操作成功');
|
|
|
+ $result2 = $api->fixbalance($login);
|
|
|
+ $res2 = json_decode($result2,true);
|
|
|
+ $tt = print_r($res2,true);
|
|
|
+ file_put_contents('mt2.txt',$tt);
|
|
|
+ if(!$res2['ret']){
|
|
|
+ $res3 = Withdraw::updateAll(['mt4_status' => 0], "id = $id"); //更新出金表的状态(mt4未扣减)
|
|
|
+ if($res3){
|
|
|
+ return $this->outJson(1, [], '操作成功');
|
|
|
+ }else{
|
|
|
+ return $this->outJson(0, [], 'fixbalance失败');
|
|
|
+ }
|
|
|
}
|
|
|
}else{
|
|
|
return $this->outJson(0, [], 'mt4操作失败');
|
|
|
@@ -387,8 +395,6 @@ class WithdrawController extends BaseController
|
|
|
}else{
|
|
|
return $this->outJson(0, [], '更新操作失败');
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|