|
|
@@ -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;
|
|
|
}
|
|
|
|
|
|
//赛事已结束
|