Skip to content

Commit

Permalink
add status FAILURE
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Dec 29, 2021
1 parent 55e4979 commit ecf0b30
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Api/Trader.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function buy(array $data,bool $show=true){

//如果交易默认完成,则不用再查询
if(isset($trader['_status'])) {
if(in_array($trader['_status'],['FAILURE'])) return ['_error'=>$trader];
if(in_array($trader['_status'],['FAILURE'])) return ['_error'=>$trader,'_status'=>'FAILURE'];
//if(in_array($trader['_status'],['CANCELLED'])) return $trader;
}

Expand Down Expand Up @@ -113,7 +113,7 @@ function sell(array $data,bool $show=true){
//如果交易默认完成,则不用再查询
//bitmex 存在可能
if(isset($trader['_status'])) {
if(in_array($trader['_status'],['FAILURE'])) return ['_error'=>$trader];
if(in_array($trader['_status'],['FAILURE'])) return ['_error'=>$trader,'_status'=>'FAILURE'];
//if(in_array($trader['_status'],['CANCELLED'])) return $trader;
}

Expand Down Expand Up @@ -173,7 +173,7 @@ function cancel(array $data,bool $show=true){

//如果交易默认完成,则不用再查询
if(isset($trader['_status'])) {
if(in_array($trader['_status'],['FAILURE'])) return ['_error'=>$trader];
if(in_array($trader['_status'],['FAILURE'])) return ['_error'=>$trader,'_status'=>'FAILURE'];
//if(in_array($trader['_status'],['CANCELLED'])) return $trader;
}

Expand Down Expand Up @@ -228,7 +228,7 @@ function show(array $data){
$trader=$this->map->responseTrader()->show(['result'=>$result,'request'=>$data]);
//print_r($trader);
if(isset($trader['_status'])) {
if(in_array($trader['_status'],['FAILURE'])) return ['_error'=>$trader];
if(in_array($trader['_status'],['FAILURE'])) return ['_error'=>$trader,'_status'=>'FAILURE'];
}

return $trader;
Expand Down

0 comments on commit ecf0b30

Please sign in to comment.