|
|
@@ -31,97 +31,61 @@ class SportsfootController extends Controller {
|
|
|
$simplex_ids = array_column($newapp->allsimplexorder($match_id,'zq'),'order_id');
|
|
|
$str_ids = array_column($newapp->allstrorder($match_id),'order_id');
|
|
|
|
|
|
-// //判断赛事下注单输赢
|
|
|
-// $datas = array('noticeid' => $noticeid , 'token' => $token);
|
|
|
-// $settlementAuto = new \App\Lib\Settlement\SettlementAuto();
|
|
|
-// $winfail = $settlementAuto->SubmitSettelement('w',$datas);
|
|
|
-// if($winfail == false){
|
|
|
-// return json_encode(['status'=>2,'msg'=>'判断输赢错误,请联系管理员!!!']);//输赢错误
|
|
|
-// }
|
|
|
-// $sim = array(
|
|
|
-// 'token'=>$token,
|
|
|
-// 'order_ids'=>$simplex_ids, //订单id字符串,用半角都好分隔
|
|
|
-// 'bettype'=>1, //结算类型 1单式 2串式
|
|
|
-// 'settype'=>2, //结算次数 1首次 2非首冷饮
|
|
|
-// 'game_code'=>$type, //赛事类型 zq lq wq bq
|
|
|
-// 'match_id'=>$match_id, // 赛事ID
|
|
|
-// 'change_status'=>1 //是否改状态
|
|
|
-// );
|
|
|
-// $str = array(
|
|
|
-// 'token'=>$token,
|
|
|
-// 'order_ids'=>$str_ids, //订单id字符串,用半角都好分隔
|
|
|
-// 'bettype'=>2, //结算类型 1单式 2串式
|
|
|
-// 'settype'=>2, //结算次数 1首次 2非首冷饮
|
|
|
-// 'game_code'=>$type, //赛事类型 zq lq wq bq
|
|
|
-// 'match_id'=>$match_id, // 赛事ID
|
|
|
-// 'change_status'=>1 //是否改状态
|
|
|
-// );
|
|
|
-// if(count($simplex_ids)>0 || count($str_ids)>0){
|
|
|
-// //单式结算
|
|
|
-// if(count($simplex_ids)>0){
|
|
|
-// $sim['order_ids'] = json_encode($simplex_ids);
|
|
|
-// $settlesim = $settlementAuto->SubmitSettelement('s',$sim);
|
|
|
-// if($settlesim == false){
|
|
|
-// return json_encode(['status'=>3,'msg'=>'单式注单结算有误,请联系管理员!!!']);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if(count($str_ids)>0){
|
|
|
-// $str['order_ids'] = json_encode($str_ids);
|
|
|
-// $settlestr = $settlementAuto->SubmitSettelement('s',$str);
|
|
|
-// if($settlestr == false){
|
|
|
-// return json_encode(['status'=>3,'msg'=>'串式注单结算有误,请联系管理员!!!']);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// return json_encode(['status'=>1,'msg'=>'结算成功']);
|
|
|
-// }else{
|
|
|
-// $log = array(
|
|
|
-// session('adminInfo.admin_name'),
|
|
|
-// );
|
|
|
-// OperationLog(session('adminInfo.admin_id'), '足球结算', $log);
|
|
|
-// $res = \App\Models\Stzqresult::where ('match_id', $match_id)->update(['status' =>3]);
|
|
|
-// $res = \App\Models\SportsSoccer::where ('id', $match_id)->update(['status' =>3]);
|
|
|
-// return json_encode(['status'=>4,'msg'=>'该赛事没有任何订单,将会结束该赛事!!!']);
|
|
|
-// }
|
|
|
-
|
|
|
+ //判断赛事下注单输赢
|
|
|
+ $datas = array('noticeid' => $noticeid , 'token' => $token);
|
|
|
+ $settlementAuto = new \App\Lib\Settlement\SettlementAuto();
|
|
|
+ $winfail = $settlementAuto->SubmitSettelement('w',$datas);
|
|
|
+ if($winfail == false){
|
|
|
+ return json_encode(['status'=>2,'msg'=>'判断输赢错误,请联系管理员!!!']);//输赢错误
|
|
|
+ }
|
|
|
+ $sim = array(
|
|
|
+ 'token'=>$token,
|
|
|
+ 'order_ids'=>$simplex_ids, //订单id字符串,用半角都好分隔
|
|
|
+ 'bettype'=>1, //结算类型 1单式 2串式
|
|
|
+ 'settype'=>2, //结算次数 1首次 2非首冷饮
|
|
|
+ 'game_code'=>$type, //赛事类型 zq lq wq bq
|
|
|
+ 'match_id'=>$match_id, // 赛事ID
|
|
|
+ 'change_status'=>1 //是否改状态
|
|
|
+ );
|
|
|
+ $str = array(
|
|
|
+ 'token'=>$token,
|
|
|
+ 'order_ids'=>$str_ids, //订单id字符串,用半角都好分隔
|
|
|
+ 'bettype'=>2, //结算类型 1单式 2串式
|
|
|
+ 'settype'=>2, //结算次数 1首次 2非首冷饮
|
|
|
+ 'game_code'=>$type, //赛事类型 zq lq wq bq
|
|
|
+ 'match_id'=>$match_id, // 赛事ID
|
|
|
+ 'change_status'=>1 //是否改状态
|
|
|
+ );
|
|
|
if(count($simplex_ids)>0 || count($str_ids)>0){
|
|
|
- $requet = file_get_contents($jsurl."/WinFail?noticeid=".$noticeid."&token=".$token);
|
|
|
-
|
|
|
- if(json_decode($requet,true)['status']==1){
|
|
|
- $napp = new \App\Models\Stzqresult();
|
|
|
- //单式结算
|
|
|
- if(count($simplex_ids)>0 && count($str_ids)==0){
|
|
|
- $huawei_res = $napp->simplexs($token,$match_id,$jsurl,'zq');
|
|
|
-
|
|
|
- if($huawei_res['status']==1){
|
|
|
- return json_encode(['status'=>1,'msg'=>'单式结算成功,没有串式订单']);
|
|
|
- }else{
|
|
|
- return json_encode(['status'=>3,'msg'=>'单式结算有误,请联系管理员!!!('.$huawei_res['msg'].')']);//结算错误
|
|
|
- }
|
|
|
- }elseif(count($str_ids)>0 && count($simplex_ids)==0){
|
|
|
- //串式结算
|
|
|
- $tandem_res = $napp->tandems($token,$match_id,$jsurl,'zq');
|
|
|
-
|
|
|
- if($tandem_res['status']==1){
|
|
|
- return json_encode(['status'=>1,'msg'=>'串式结算成功,没有单式订单']);
|
|
|
- }else{
|
|
|
- return json_encode(['status'=>3,'msg'=>'串式结算有误,请联系管理员!!!('.$tandem_res['msg'].')']);//结算错误
|
|
|
- }
|
|
|
- }elseif(count($str_ids)>0 && count($simplex_ids)>0){
|
|
|
- //既有单式又有串式
|
|
|
- $huawei_res = $napp->simplexs($token,$match_id,$jsurl,'zq');
|
|
|
-
|
|
|
- //串式结算
|
|
|
- $tandem_res = $napp->tandems($token,$match_id,$jsurl,'zq');
|
|
|
- if($tandem_res['status']==1 && $huawei_res['status']==1){
|
|
|
- return json_encode(['status'=>1,'msg'=>'结算成功']);
|
|
|
- }elseif($tandem_res['status']!=1 || $huawei_res['status']!=1){
|
|
|
- return json_encode(['status'=>3,'msg'=>'结算有误,请联系管理员!!!('.$tandem_res['msg'].$huawei_res['msg'].')']);
|
|
|
- }else{
|
|
|
- return json_encode(['status'=>3,'msg'=>'返回参数不对']);
|
|
|
- }
|
|
|
+ //单式结算
|
|
|
+ if(count($simplex_ids)>0 && count($str_ids)==0){
|
|
|
+ $sim['order_ids'] = json_encode($simplex_ids);
|
|
|
+ $settlesim = $settlementAuto->SubmitSettelement('s',$sim);
|
|
|
+ if($settlesim == false){
|
|
|
+ return json_encode(['status'=>3,'msg'=>'单式注单结算有误,请联系管理员!!!']);
|
|
|
+ }else{
|
|
|
+ return json_encode(['status'=>1,'msg'=>'单式结算成功,没有串式订单']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ elseif(count($str_ids)>0 && count($simplex_ids)==0){
|
|
|
+ $str['order_ids'] = json_encode($str_ids);
|
|
|
+ $settlestr = $settlementAuto->SubmitSettelement('s',$str);
|
|
|
+ if($settlestr == false){
|
|
|
+ return json_encode(['status'=>3,'msg'=>'串式注单结算有误,请联系管理员!!!']);
|
|
|
+ }else{
|
|
|
+ return json_encode(['status'=>1,'msg'=>'串式结算成功,没有单式订单']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ elseif(count($str_ids)>0 && count($simplex_ids)>0){
|
|
|
+ $sim['order_ids'] = json_encode($simplex_ids);
|
|
|
+ $str['order_ids'] = json_encode($str_ids);
|
|
|
+ $settlesim = $settlementAuto->SubmitSettelement('s',$sim);
|
|
|
+ $settlestr = $settlementAuto->SubmitSettelement('s',$str);
|
|
|
+ if($settlesim == true || $settlestr == true){
|
|
|
+ return json_encode(['status'=>1,'msg'=>'结算成功']);
|
|
|
+ }else{
|
|
|
+ return json_encode(['status'=>3,'msg'=>'结算有误,请联系管理员!!!']);
|
|
|
}
|
|
|
- }else{
|
|
|
- return json_encode(['status'=>2,'msg'=>'判断输赢错误,请联系管理员!!!']);;//输赢错误
|
|
|
}
|
|
|
}else{
|
|
|
$log = array(
|
|
|
@@ -129,9 +93,59 @@ class SportsfootController extends Controller {
|
|
|
);
|
|
|
OperationLog(session('adminInfo.admin_id'), '足球结算', $log);
|
|
|
$res = \App\Models\Stzqresult::where ('match_id', $match_id)->update(['status' =>3]);
|
|
|
- $res = \App\Models\SportsSoccer::where ('match_id', $match_id)->update(['status' =>3]);
|
|
|
- return json_encode(['status'=>4,'msg'=>'该赛事没有任何订单,将会结束该赛事!!!']);
|
|
|
+ $res = \App\Models\SportsSoccer::where ('id', $match_id)->update(['status' =>3]);
|
|
|
+ return json_encode(['status'=>4,'msg'=>'该赛事没有任何订单,将会结束该赛事!!!']);
|
|
|
}
|
|
|
+
|
|
|
+// if(count($simplex_ids)>0 || count($str_ids)>0){
|
|
|
+// $requet = file_get_contents($jsurl."/WinFail?noticeid=".$noticeid."&token=".$token);
|
|
|
+//
|
|
|
+// if(json_decode($requet,true)['status']==1){
|
|
|
+// $napp = new \App\Models\Stzqresult();
|
|
|
+// //单式结算
|
|
|
+// if(count($simplex_ids)>0 && count($str_ids)==0){
|
|
|
+// $huawei_res = $napp->simplexs($token,$match_id,$jsurl,'zq');
|
|
|
+//
|
|
|
+// if($huawei_res['status']==1){
|
|
|
+// return json_encode(['status'=>1,'msg'=>'单式结算成功,没有串式订单']);
|
|
|
+// }else{
|
|
|
+// return json_encode(['status'=>3,'msg'=>'单式结算有误,请联系管理员!!!('.$huawei_res['msg'].')']);//结算错误
|
|
|
+// }
|
|
|
+// }elseif(count($str_ids)>0 && count($simplex_ids)==0){
|
|
|
+// //串式结算
|
|
|
+// $tandem_res = $napp->tandems($token,$match_id,$jsurl,'zq');
|
|
|
+//
|
|
|
+// if($tandem_res['status']==1){
|
|
|
+// return json_encode(['status'=>1,'msg'=>'串式结算成功,没有单式订单']);
|
|
|
+// }else{
|
|
|
+// return json_encode(['status'=>3,'msg'=>'串式结算有误,请联系管理员!!!('.$tandem_res['msg'].')']);//结算错误
|
|
|
+// }
|
|
|
+// }elseif(count($str_ids)>0 && count($simplex_ids)>0){
|
|
|
+// //既有单式又有串式
|
|
|
+// $huawei_res = $napp->simplexs($token,$match_id,$jsurl,'zq');
|
|
|
+//
|
|
|
+// //串式结算
|
|
|
+// $tandem_res = $napp->tandems($token,$match_id,$jsurl,'zq');
|
|
|
+// if($tandem_res['status']==1 && $huawei_res['status']==1){
|
|
|
+// return json_encode(['status'=>1,'msg'=>'结算成功']);
|
|
|
+// }elseif($tandem_res['status']!=1 || $huawei_res['status']!=1){
|
|
|
+// return json_encode(['status'=>3,'msg'=>'结算有误,请联系管理员!!!('.$tandem_res['msg'].$huawei_res['msg'].')']);
|
|
|
+// }else{
|
|
|
+// return json_encode(['status'=>3,'msg'=>'返回参数不对']);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// return json_encode(['status'=>2,'msg'=>'判断输赢错误,请联系管理员!!!']);;//输赢错误
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// $log = array(
|
|
|
+// session('adminInfo.admin_name'),
|
|
|
+// );
|
|
|
+// OperationLog(session('adminInfo.admin_id'), '足球结算', $log);
|
|
|
+// $res = \App\Models\Stzqresult::where ('match_id', $match_id)->update(['status' =>3]);
|
|
|
+// $res = \App\Models\SportsSoccer::where ('match_id', $match_id)->update(['status' =>3]);
|
|
|
+// return json_encode(['status'=>4,'msg'=>'该赛事没有任何订单,将会结束该赛事!!!']);
|
|
|
+// }
|
|
|
|
|
|
}
|
|
|
|