Jelajahi Sumber

解决移动版滚球详情比分显示错误

彭俊 6 tahun lalu
induk
melakukan
8eaf56f7eb

+ 17 - 4
Application/Sports/Controller/MatchList.php

@@ -525,6 +525,13 @@ class  MatchList extends Controller {
             $matchData->ptime = '';//赛事进行时间
             $matchData->match_score = '';//赛事比分
             $matchData->result_mark = '';//赛事实时数据json
+
+
+            //通过开赛日期和时间判断是否是进行中滚球
+            if($matchData->status < 2 and $matchData->match_date == date("Y-m-d") and $matchData->match_time > date("H:i:s", time()-(90*60)) and $matchData->match_time < date("H:i:s", time())){
+                $matchData->status = 1;
+            }
+
             //如果该赛事正在进行,则获取进行时间
             if($matchData->status ==1){
                 $result_record = $models['model_result_record'];
@@ -537,7 +544,9 @@ where a.match_id = b.match_id and a.id = b.id ";
 
                     //查询 赛事结果记录最新的一条
                     $match_result_record = S ('DB')->select ($sql);
-                    $matchData->match_score = $match_result_record[0]->home_score.'-'.$match_result_record[0]->guest_score;
+                    $home_score = $match_result_record[0]->home_score?:0;
+                    $guest_score = $match_result_record[0]->guest_score?:0;
+                    $matchData->match_score = $home_score.'-'.$guest_score;
                     $matchData->result_mark = $match_result_record[0]->result_mark;
                 }
 
@@ -549,7 +558,9 @@ where a.match_id = b.match_id and a.id = b.id ";
 
                     //查询 赛事结果记录最新的一条
                     $match_result_record = S ('DB')->select ($sql);
-                    $matchData->match_score = $match_result_record[0]->home_player_score.'-'.$match_result_record[0]->guest_player_score;
+                    $home_score = $match_result_record[0]->home_player_score?:0;
+                    $guest_score = $match_result_record[0]->guest_player_score?:0;
+                    $matchData->match_score = $home_score.'-'.$guest_score;
                     $matchData->result_mark = $match_result_record[0]->result_mark;
 
                 }else{
@@ -560,10 +571,12 @@ where a.match_id = b.match_id and a.id = b.id ";
 
                     //查询 赛事结果记录最新的一条
                     $match_result_record = S ('DB')->select ($sql);
-                    $matchData->match_score = $match_result_record[0]->home_score.'-'.$match_result_record[0]->guest_score;
+                    $home_score = $match_result_record[0]->home_score?:0;
+                    $guest_score = $match_result_record[0]->guest_score?:0;
+                    $matchData->match_score = $home_score.'-'.$guest_score;
                     $matchData->result_mark = '';
                 }
-                $matchData->ptime = $match_result_record[0]->a_time;
+                $matchData->ptime = $match_result_record[0]->a_time?:0;
             }
 
             //赛事已结束

+ 1 - 1
Application/Sports/Model/St_zq_competition.php

@@ -78,7 +78,7 @@ where a.match_id = b.match_id and a.id = b.id ";
                                 $matchData[$k]['guest_score'] = $vv->guest_score?:0;
                             }
                             $matchData[$k]['a_time'] = $vv->a_time?:0;
-                            $matchData[$k]['match_process'] = $vv->match_process?:'NA';
+                            $matchData[$k]['match_process'] = $vv->match_process?:'';
                         }
                     }
                 }else{