彭俊 6 жил өмнө
parent
commit
b9bc468207

+ 6 - 28
app/Http/Controllers/Api/WriteSportsController.php

@@ -280,32 +280,7 @@ class WriteSportsController extends BaseController{
             foreach($matchData as $k=>$v){
                 $s_match_ids[] = $v['match_id'];
             }
-            /*
-            //循环对比 请求uuid->本地identity
-            foreach($l_lg_data as $k=>$v){
-                foreach($identity as $kk=> $uuid){
-                    if($v['identity'] == $uuid){
-                        unset($identity[$kk]);
-                    }
-                }
-            }
-            sort($identity);
-            //去除本地和请求里都存在的联赛,如果还有剩余联赛id,则返回异常
-            if(!empty($identity))  throw new \Exception(Response::generate($gameName.'联赛:uuid-'.$identity[0].';',Response::LEAGUE_ERROR));
-            //如果有剩余联赛,则表示该赛事找不到联赛,将其删除
-            if(!empty($identity)){
-                foreach($matchData as $k=>$v){
-                    foreach($identity as $kk=> $uuid){
-                        if($v['uuid'] == $uuid){
-                            unset($matchData[$k]);
-                        }
-                    }
-                }
-                sort($matchData);
-            }
-            //====end====
-            */
-
+           
             //====获取 本地 已存在 赛事====
             $s_match_ids = array_unique($s_match_ids);
             sort($s_match_ids);
@@ -371,7 +346,6 @@ class WriteSportsController extends BaseController{
                                 'status'=>$data['status'],
                                 'match_date'=>$data['match_date']?:date('Y-m-d'),
                                 'match_time'=>$data['match_time']?:date('H:i:s'),
-                                // 'tag'=>$data['tag']?:0,
                                 'is_rollball'=>$data['is_rollball']?:0,
                                 'is_today'=>$data['is_today']?:0,
                                 'is_morningplate'=>$data['is_morningplate']?:0,
@@ -379,7 +353,11 @@ class WriteSportsController extends BaseController{
                                 'us_time'=>$data['us_time']?:commonFunction::qgmdate('Y-m-d H:i:s', '', -4),
                                 'half_match_id'=>$half_match_id?:0,
                                 'identity' => $data['uuid'],
-                            ];                           
+                            ];         
+                            //如果是网球 追加rule 字段
+                            if($game_code == 'wq'){
+                                $set_match['rule'] = $data['rule'];
+                            }                  
                             //写入赛事 返回id
                             $id = $models['model_match']::insertGetId($set_match);
                             if($id < 1) throw new \Exception(Response::generate($gameName.'赛事-match_id:'.$data['match_id'].';',Response::INSERT_ERROR)) ;