|
@@ -31,15 +31,67 @@ class SportsfootController extends Controller {
|
|
|
$simplex_ids = array_column($newapp->allsimplexorder($match_id,'zq'),'order_id');
|
|
$simplex_ids = array_column($newapp->allsimplexorder($match_id,'zq'),'order_id');
|
|
|
$str_ids = array_column($newapp->allstrorder($match_id),'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'=>'该赛事没有任何订单,将会结束该赛事!!!']);
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
if(count($simplex_ids)>0 || count($str_ids)>0){
|
|
if(count($simplex_ids)>0 || count($str_ids)>0){
|
|
|
$requet = file_get_contents($jsurl."/WinFail?noticeid=".$noticeid."&token=".$token);
|
|
$requet = file_get_contents($jsurl."/WinFail?noticeid=".$noticeid."&token=".$token);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if(json_decode($requet,true)['status']==1){
|
|
if(json_decode($requet,true)['status']==1){
|
|
|
$napp = new \App\Models\Stzqresult();
|
|
$napp = new \App\Models\Stzqresult();
|
|
|
//单式结算
|
|
//单式结算
|
|
|
if(count($simplex_ids)>0 && count($str_ids)==0){
|
|
if(count($simplex_ids)>0 && count($str_ids)==0){
|
|
|
$huawei_res = $napp->simplexs($token,$match_id,$jsurl,'zq');
|
|
$huawei_res = $napp->simplexs($token,$match_id,$jsurl,'zq');
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if($huawei_res['status']==1){
|
|
if($huawei_res['status']==1){
|
|
|
return json_encode(['status'=>1,'msg'=>'单式结算成功,没有串式订单']);
|
|
return json_encode(['status'=>1,'msg'=>'单式结算成功,没有串式订单']);
|
|
|
}else{
|
|
}else{
|
|
@@ -61,11 +113,11 @@ class SportsfootController extends Controller {
|
|
|
//串式结算
|
|
//串式结算
|
|
|
$tandem_res = $napp->tandems($token,$match_id,$jsurl,'zq');
|
|
$tandem_res = $napp->tandems($token,$match_id,$jsurl,'zq');
|
|
|
if($tandem_res['status']==1 && $huawei_res['status']==1){
|
|
if($tandem_res['status']==1 && $huawei_res['status']==1){
|
|
|
- return json_encode(['status'=>1,'msg'=>'结算成功']);
|
|
|
|
|
|
|
+ return json_encode(['status'=>1,'msg'=>'结算成功']);
|
|
|
}elseif($tandem_res['status']!=1 || $huawei_res['status']!=1){
|
|
}elseif($tandem_res['status']!=1 || $huawei_res['status']!=1){
|
|
|
return json_encode(['status'=>3,'msg'=>'结算有误,请联系管理员!!!('.$tandem_res['msg'].$huawei_res['msg'].')']);
|
|
return json_encode(['status'=>3,'msg'=>'结算有误,请联系管理员!!!('.$tandem_res['msg'].$huawei_res['msg'].')']);
|
|
|
}else{
|
|
}else{
|
|
|
- return json_encode(['status'=>3,'msg'=>'返回参数不对']);
|
|
|
|
|
|
|
+ return json_encode(['status'=>3,'msg'=>'返回参数不对']);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
@@ -78,7 +130,7 @@ class SportsfootController extends Controller {
|
|
|
OperationLog(session('adminInfo.admin_id'), '足球结算', $log);
|
|
OperationLog(session('adminInfo.admin_id'), '足球结算', $log);
|
|
|
$res = \App\Models\Stzqresult::where ('match_id', $match_id)->update(['status' =>3]);
|
|
$res = \App\Models\Stzqresult::where ('match_id', $match_id)->update(['status' =>3]);
|
|
|
$res = \App\Models\SportsSoccer::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'=>'该赛事没有任何订单,将会结束该赛事!!!']);
|
|
|
|
|
|
|
+ return json_encode(['status'=>4,'msg'=>'该赛事没有任何订单,将会结束该赛事!!!']);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|