|
|
@@ -34,8 +34,9 @@ class Sports extends Controller{
|
|
|
$data['all']['name'] ='今日赛事';
|
|
|
$data['all']['game_code'] = $game_code;
|
|
|
$data['all']['code'] = 'today';
|
|
|
- $data['all']['count'] = lm($st_competition,'Sports')
|
|
|
+ $matchData = lm($st_competition,'Sports')
|
|
|
->join($st_league,$st_league.'.id',$st_competition.'.lg_id')
|
|
|
+ ->select($st_competition.'.id as match_id')
|
|
|
->where(getState('StToday',$st_competition))
|
|
|
->where([
|
|
|
[$st_competition.'.home_team','<>',null],
|
|
|
@@ -44,13 +45,16 @@ class Sports extends Controller{
|
|
|
[$st_competition.'.status','<',2],
|
|
|
[$st_competition.'.us_time','>',$this->commonFunction->qgmdate('Y-m-d H:i:s', '', -4)]
|
|
|
])
|
|
|
- ->count('*');
|
|
|
+ ->get()
|
|
|
+ ->toArray();
|
|
|
+ // ->count('*');
|
|
|
} else {
|
|
|
$data['all']['name'] = '所有赛事';
|
|
|
$data['all']['game_code'] = $game_code;
|
|
|
$data['all']['code'] = 'all';
|
|
|
- $data['all']['count'] = lm($st_competition,'Sports')
|
|
|
+ $matchData = lm($st_competition,'Sports')
|
|
|
->join($st_league,$st_league.'.id',$st_competition.'.lg_id')
|
|
|
+ ->select($st_competition.'.id as match_id')
|
|
|
->where([[$st_competition.'.status', '<', '2']])
|
|
|
->where([
|
|
|
[$st_competition.'.home_team','<>',null],
|
|
|
@@ -60,8 +64,13 @@ class Sports extends Controller{
|
|
|
[$st_competition.'.us_time','>',$this->commonFunction->qgmdate('Y-m-d H:i:s', '', -4)]
|
|
|
])
|
|
|
->where($st_competition.'.us_time','>',$this->commonFunction->qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
- ->count('*');
|
|
|
+ ->get()
|
|
|
+ ->toArray();
|
|
|
+ // ->count('*');
|
|
|
}
|
|
|
+ //===获取当前赛事是否有赔率,如果没有则去除===
|
|
|
+ $matchData = $this->commonFunction->Handle_Odds_Null($matchData,$getModels);
|
|
|
+ $data['all']['count'] = count($matchData);
|
|
|
//查询正在进行的和未开始的球类比赛
|
|
|
$data['match'] = lm($st_competition,"Sports")
|
|
|
->join($st_league,$st_league.'.id',$st_competition.'.lg_id')
|