|
|
@@ -107,14 +107,24 @@ class SportsfootController extends Controller {
|
|
|
$simplex_ids = array_column($newapp->allsimplexorder($ssid,'zq'),'order_id');
|
|
|
$str_ids = array_column($newapp->allstrorder($ssid),'order_id');
|
|
|
|
|
|
- $update = $this->addcomendnotice($ssid);
|
|
|
- if($update['status']==1){
|
|
|
+ $data = \App\Models\Comendnotice::where(['match_id'=>$match_id,'game_code'=>'zq'])->first();
|
|
|
+ if($data){
|
|
|
+ $newapp = new \App\Lib\Settlement\SettlementWinFail();
|
|
|
+ \App\Models\Comendnotice::where(['match_id'=>$match_id,'game_code'=>'zq'])->update(['status'=>0]);
|
|
|
+ $ret = $newapp->doRun($data->toArray()['id']);
|
|
|
+ $ret2 =$data->toArray()['id'];
|
|
|
+ if ($ret2['status']==1){
|
|
|
+ \App\Models\Comendnotice::where(['match_id'=>$match_id,'game_code'=>'zq'])->update(['status'=>4]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if($ret['status']==1){
|
|
|
$SettlementOrder = new SettlementOrder();
|
|
|
$SettlementOrder->reSettlement($str_ids, 2,$type,'zq',$ssid);//串式
|
|
|
$data = $SettlementOrder->reSettlement($simplex_ids, 1,$type,'zq',$ssid);//单式注单
|
|
|
return responseToJson($data);
|
|
|
}else{
|
|
|
- return responseToJson($update);
|
|
|
+ return responseToJson($ret);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -305,30 +315,32 @@ class SportsfootController extends Controller {
|
|
|
$id = $req->id;
|
|
|
$num = $req->num;
|
|
|
$match_id = $req->match_id;
|
|
|
+
|
|
|
$newapp = new \App\Models\Stzqresult();
|
|
|
- $update = $this->addcomendnotice($match_id);
|
|
|
- if($update['status']==1){
|
|
|
- if($type==1){
|
|
|
- $data['u_home_score'] = $num;
|
|
|
- $res = $newapp->updateInfo($data,$id);//联赛id
|
|
|
- }else if($type==2){
|
|
|
- $data['u_guest_score'] = $num;
|
|
|
- $res = $newapp->updateInfo($data,$id);//联赛id
|
|
|
- }else if($type==3){
|
|
|
- $data['home_score'] = $num;
|
|
|
- $res = $newapp->updateInfo($data,$id);//联赛id
|
|
|
- }else{
|
|
|
- $data['guest_score'] = $num;
|
|
|
- $res = $newapp->updateInfo($data,$id);//联赛id
|
|
|
- }
|
|
|
- $newapp->totalgoal($match_id);
|
|
|
- $update = $this->addcomendnotice($match_id);
|
|
|
- return responseToJson($res);
|
|
|
+
|
|
|
+ if($type==1){
|
|
|
+ $data['u_home_score'] = $num;
|
|
|
+ $res = $newapp->updateInfo($data,$id);//联赛id
|
|
|
+ }else if($type==2){
|
|
|
+ $data['u_guest_score'] = $num;
|
|
|
+ $res = $newapp->updateInfo($data,$id);//联赛id
|
|
|
+ }else if($type==3){
|
|
|
+ $data['home_score'] = $num;
|
|
|
+ $res = $newapp->updateInfo($data,$id);//联赛id
|
|
|
}else{
|
|
|
- return responseToJson($update);
|
|
|
+ $data['guest_score'] = $num;
|
|
|
+ $res = $newapp->updateInfo($data,$id);//联赛id
|
|
|
}
|
|
|
- }
|
|
|
+ $newapp->totalgoal($match_id);
|
|
|
+ $update = $this->addcomendnotice($match_id);
|
|
|
+
|
|
|
+ $twoapp = new \App\Models\SportsSoccer();
|
|
|
+ $twoapp->updatestatus('match_id',$match_id,['status'=>2]);//修改赛事状态
|
|
|
+ $newapp->updatestatus('match_id',$match_id,['status'=>2]);//修改结果状态
|
|
|
|
|
|
+ return responseToJson(1);
|
|
|
+ }
|
|
|
+
|
|
|
//添加赛事结束纪录
|
|
|
function addcomendnotice($match_id){
|
|
|
$data = \App\Models\Comendnotice::where(['match_id'=>$match_id,'game_code'=>'zq'])->first();
|
|
|
@@ -339,19 +351,8 @@ class SportsfootController extends Controller {
|
|
|
$model->match_id = $match_id;//赛事id
|
|
|
$model->ctime = date('Y-m-d H:i:s');
|
|
|
$model->save();
|
|
|
-
|
|
|
- $newapp = new \App\Lib\Settlement\SettlementWinFail();
|
|
|
- $ret = $newapp->doRun($model->id);
|
|
|
- }else{
|
|
|
- $newapp = new \App\Lib\Settlement\SettlementWinFail();
|
|
|
- \App\Models\Comendnotice::where(['match_id'=>$match_id,'game_code'=>'zq'])->update(['status'=>0]);
|
|
|
- $ret = $newapp->doRun($data->toArray()['id']);
|
|
|
- $ret2 =$data->toArray()['id'];
|
|
|
- if ($ret2['status']==1){
|
|
|
- \App\Models\Comendnotice::where(['match_id'=>$match_id,'game_code'=>'zq'])->update(['status'=>4]);
|
|
|
- }
|
|
|
}
|
|
|
- return $ret;
|
|
|
+ return responseToJson(1);
|
|
|
}
|
|
|
|
|
|
|