|
|
@@ -55,7 +55,7 @@ class Sports extends Controller{
|
|
|
$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.'.status', '<', '2']])
|
|
|
->where([
|
|
|
[$st_competition.'.home_team','<>',null],
|
|
|
[$st_competition.'.guest_team','<>',null],
|
|
|
@@ -63,7 +63,7 @@ class Sports extends Controller{
|
|
|
[$st_competition.'.status','<',2],
|
|
|
[$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))
|
|
|
+ // ->where($st_competition.'.us_time','>',$this->commonFunction->qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
->get()
|
|
|
->toArray();
|
|
|
// ->count('*');
|
|
|
@@ -75,8 +75,8 @@ class Sports extends Controller{
|
|
|
$data['match'] = lm($st_competition,"Sports")
|
|
|
->join($st_league,$st_league.'.id',$st_competition.'.lg_id')
|
|
|
->select($st_competition.'.id as match_id',$st_competition.'.home_team',$st_competition.'.guest_team',$st_competition.'.match_date',$st_competition.'.match_time')
|
|
|
- ->where([[$st_competition.'.status','<',2]])
|
|
|
- ->where($st_competition.'.us_time','>',$this->commonFunction->qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
+ // ->where([[$st_competition.'.status','<',2]])
|
|
|
+ // ->where($st_competition.'.us_time','>',$this->commonFunction->qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
->where($where)
|
|
|
->where([
|
|
|
[$st_competition.'.home_team','<>',null],
|
|
|
@@ -87,7 +87,7 @@ class Sports extends Controller{
|
|
|
])
|
|
|
->limit($limit_mt)
|
|
|
->get()
|
|
|
- ->toarray();
|
|
|
+ ->toArray();
|
|
|
|
|
|
//===获取当前赛事是否有赔率,如果没有则去除===
|
|
|
$data['match'] = $this->commonFunction->Handle_Odds_Null($data['match'],$getModels);
|
|
|
@@ -96,11 +96,12 @@ class Sports extends Controller{
|
|
|
$data['match'] = $data['match'];
|
|
|
}
|
|
|
// 获取正在进行的和未开始联赛
|
|
|
+/*
|
|
|
$data['league'] = lm($st_competition,"Sports")
|
|
|
->join($st_league,$st_league.'.id',$st_competition.'.lg_id')
|
|
|
->select($st_league.'.id as lg_id',$st_league.'.name_chinese',$st_competition.'.id as match_id')
|
|
|
- ->where([[$st_competition.'.status','<',2]])
|
|
|
- ->where($st_competition.'.us_time','>',$this->commonFunction->qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
+ // ->where([[$st_competition.'.status','<',2]])
|
|
|
+ // ->where($st_competition.'.us_time','>',$this->commonFunction->qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
->where($where)
|
|
|
->where([
|
|
|
[$st_competition.'.home_team','<>',null],
|
|
|
@@ -112,7 +113,26 @@ class Sports extends Controller{
|
|
|
->limit($limit_lg)
|
|
|
->distinct($st_league.'id')
|
|
|
->get()
|
|
|
- ->toarray();
|
|
|
+ ->toArray();
|
|
|
+ */
|
|
|
+
|
|
|
+ $data['league'] = lm($st_league,"Sports")
|
|
|
+ ->join($st_competition,$st_competition.'.lg_id',$st_league.'.id')
|
|
|
+ ->select($st_league.'.id as lg_id',$st_league.'.name_chinese',$st_competition.'.id as match_id')
|
|
|
+ ->where($where)
|
|
|
+ ->where([
|
|
|
+ [$st_competition.'.home_team','<>',null],
|
|
|
+ [$st_competition.'.guest_team','<>',null],
|
|
|
+ [$st_league.'.name_chinese','<>',null],
|
|
|
+ [$st_competition.'.status','<',2],
|
|
|
+ [$st_competition.'.us_time','>',$this->commonFunction->qgmdate('Y-m-d H:i:s', '', -4)]
|
|
|
+ ])
|
|
|
+ ->limit($limit_lg)
|
|
|
+ ->distinct($st_league.'id')
|
|
|
+ ->get()
|
|
|
+ ->toArray();
|
|
|
+ //去重
|
|
|
+ $data['league'] = $this->commonFunction->array_unset_tt($data['league'],'lg_id');
|
|
|
|
|
|
//===获取当前赛事是否有赔率,如果没有则去除===
|
|
|
$data['league'] = $this->commonFunction->Handle_Odds_Null($data['league'],$getModels);
|
|
|
@@ -124,7 +144,7 @@ class Sports extends Controller{
|
|
|
$data['league'][$k]['code'] = "qt";
|
|
|
$matchData = lm($st_competition,'Sports')
|
|
|
->select($st_competition.'.id as match_id')
|
|
|
- ->where([[$st_competition.'.status','<',2]])
|
|
|
+ // ->where([[$st_competition.'.status','<',2]])
|
|
|
->where('lg_id',$v['lg_id'])
|
|
|
->where($where)
|
|
|
->where([
|
|
|
@@ -139,6 +159,7 @@ class Sports extends Controller{
|
|
|
$matchNum = $this->commonFunction->Handle_Odds_Null($matchData,$getModels);
|
|
|
$data['league'][$k]['count'] = count($matchNum);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
return $data;
|
|
|
}
|