|
|
@@ -295,17 +295,47 @@ class WriteSportsController extends BaseController{
|
|
|
$l_match_data = commonFunction::uniquArrV2($l_match_data,'others_match_id');
|
|
|
|
|
|
//循环对比 请求match_id->本地others_match_id
|
|
|
- //如果本地有 赛事,则取出本地不存在赛事
|
|
|
+ //如果本地有 赛事,则分别获取本地已存在/不存在赛事
|
|
|
if(!empty($l_match_data)){
|
|
|
+ //本地已存在赛事,用于更新
|
|
|
+ $matchData_y = [];
|
|
|
foreach($l_match_data as $k=>$v){
|
|
|
foreach($s_match_ids as $kk=> $s_match_id){
|
|
|
if($v['others_match_id'] == $s_match_id){
|
|
|
+ $matchData_y[$k]['others_match_id'] = $s_match_id;
|
|
|
+ $matchData_y[$k]['match_id'] = $v['match_id'];
|
|
|
unset($s_match_ids[$kk]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
sort($s_match_ids);
|
|
|
}
|
|
|
+ //如果 请求中 有本地赛事,则执行更新
|
|
|
+ if(!empty($matchData_y)){
|
|
|
+ foreach($matchData as $k=>$v){
|
|
|
+ foreach($matchData_y as $kk=> $vv){
|
|
|
+ if($v['match_id'] == $vv['others_match_id']){
|
|
|
+ $data = $v;
|
|
|
+ $up_match = [
|
|
|
+ 'utime'=>date('Y-m-d H:i:s'),
|
|
|
+ 'status'=>$data['status'],
|
|
|
+ 'is_rollball'=>$data['is_rollball']?:0,
|
|
|
+ 'is_today'=>$data['is_today']?:0,
|
|
|
+ 'is_morningplate'=>$data['is_morningplate']?:0,
|
|
|
+ 'is_stringscene'=>$data['is_stringscene']?:0,
|
|
|
+ ];
|
|
|
+ //如果是网球 追加rule 字段
|
|
|
+ if($game_code == 'wq' and !empty($data['rule'])){
|
|
|
+ $up_match['rule'] = $data['rule'];
|
|
|
+ }
|
|
|
+ //更新赛事 返回成功数量
|
|
|
+ $set = $models['model_match']::where(['id'=>$vv['match_id']])
|
|
|
+ ->update($up_match);
|
|
|
+ if($set < 1) throw new \Exception(Response::generate($gameName.'赛事-match_id:'.$data['match_id'].';',Response::UPSTATUS_ERROR)) ;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//剩余 赛事 数据 写入
|
|
|
if(!empty($s_match_ids)){
|
|
|
@@ -320,15 +350,6 @@ class WriteSportsController extends BaseController{
|
|
|
$lg_id = commonFunction::searcharray($data['uuid'],'identity',$l_lg_data,'lg_id');
|
|
|
//验证 本赛事是否获取到本地lg_id
|
|
|
if(empty($lg_id)) throw new \Exception(Response::generate($gameName.'赛事-match_id:'.$data['match_id'].';',Response::L_LG_ID_NULL));
|
|
|
- /*
|
|
|
- //如果有上半场赛事id 获取上半场赛事是否存在
|
|
|
- if(!empty($l_match_data) and $data['half_match_id'] > 0){
|
|
|
- $half_match_id = -1;
|
|
|
- $half_match_id = $models['model_local_match']::where(['others_match_id'=>$data['half_match_id'],'source'=>$source])
|
|
|
- ->value('match_id');
|
|
|
- if(empty($half_match_id)) throw new \Exception(Response::generate($gameName.'上半场赛事-match_id:'.$data['match_id'].';',Response::HALF_MATCH_ERROR)) ;//Render([], '10024', lang('Tips','Sports')->get('half_match_error'));
|
|
|
- }
|
|
|
- */
|
|
|
//如果赛事没有开始日期,则为冠军盘口赛事
|
|
|
if(empty($data['match_date'])){
|
|
|
//冠军盘口赛事获取所属联赛结束时间
|
|
|
@@ -549,6 +570,8 @@ class WriteSportsController extends BaseController{
|
|
|
$s_match_id = $getData['match_id'];
|
|
|
//获取赔率所属赛事 tag 值 玩法数量
|
|
|
$tag = $getData['tag']?:99;
|
|
|
+ //获取赔率是否是串场
|
|
|
+ $is_stringscene = $getData['is_stringscene'];
|
|
|
|
|
|
//获取球类名称
|
|
|
$gameName = gameModel::getGameName($game_code);
|
|
|
@@ -607,6 +630,7 @@ class WriteSportsController extends BaseController{
|
|
|
'type'=> $v['type']?:0,
|
|
|
'team'=> $v['team']?:'',
|
|
|
'lg_id'=> $lg_id,
|
|
|
+ 'is_stringscene'=>$is_stringscene,
|
|
|
'others_lg_id'=> $v['lg_id'],
|
|
|
'ctime'=> date('Y-m-d H:i:s'),
|
|
|
'utime'=> date('Y-m-d H:i:s'),
|
|
|
@@ -630,6 +654,7 @@ class WriteSportsController extends BaseController{
|
|
|
'type'=> $v['type']?:0,
|
|
|
'team'=> $v['team']?:'',
|
|
|
'lg_id'=> $lg_id,
|
|
|
+ 'is_stringscene'=>$is_stringscene,
|
|
|
'others_lg_id'=> $v['lg_id'],
|
|
|
'ctime'=> date('Y-m-d H:i:s'),
|
|
|
'utime'=> date('Y-m-d H:i:s'),
|
|
|
@@ -1138,7 +1163,7 @@ class WriteSportsController extends BaseController{
|
|
|
if(empty($obt)) throw new \Exception(Response::generate('请求数据为空,',Response::ABNORMAL));
|
|
|
$getData = $this->getAddData($obt);
|
|
|
//不是 直播 数据
|
|
|
- if($getData['title'] != '"match_status",') throw new \Exception(Response::generate('不是更新赛事状态数据',Response::ABNORMAL));
|
|
|
+ if($getData['title'] != 'match_status') throw new \Exception(Response::generate('不是更新赛事状态数据',Response::ABNORMAL));
|
|
|
|
|
|
//写请求数据 日志记录
|
|
|
if($this->isRecord){
|