|
@@ -181,6 +181,8 @@ class MatchList extends Controller {
|
|
|
->select($st_league.'.name_chinese',$st_league.'.lg_id')
|
|
->select($st_league.'.name_chinese',$st_league.'.lg_id')
|
|
|
->where($where)
|
|
->where($where)
|
|
|
->where($where_search)
|
|
->where($where_search)
|
|
|
|
|
+ ->where($st_competition.'.home_team','<>',null)
|
|
|
|
|
+ ->where($st_competition.'.guest_team','<>',null)
|
|
|
->where($st_competition.'.source',$this->source['source'])
|
|
->where($st_competition.'.source',$this->source['source'])
|
|
|
->distinct($st_competition.'.match_id')
|
|
->distinct($st_competition.'.match_id')
|
|
|
->get()
|
|
->get()
|
|
@@ -358,8 +360,6 @@ class MatchList extends Controller {
|
|
|
->where($where)
|
|
->where($where)
|
|
|
->where($Orwhere)
|
|
->where($Orwhere)
|
|
|
->where($where_search)
|
|
->where($where_search)
|
|
|
- ->where($st_competition.'.home_team','<>',null)
|
|
|
|
|
- ->where($st_competition.'.guest_team','<>',null)
|
|
|
|
|
->distinct($st_competition.'.match_id')
|
|
->distinct($st_competition.'.match_id')
|
|
|
->count($st_competition.'.match_id');
|
|
->count($st_competition.'.match_id');
|
|
|
|
|
|
|
@@ -375,8 +375,6 @@ class MatchList extends Controller {
|
|
|
->where($Orwhere)
|
|
->where($Orwhere)
|
|
|
->where($where_search)
|
|
->where($where_search)
|
|
|
->where($st_competition.'.lg_id',$v['lg_id'])
|
|
->where($st_competition.'.lg_id',$v['lg_id'])
|
|
|
- ->where($st_competition.'.home_team','<>',null)
|
|
|
|
|
- ->where($st_competition.'.guest_team','<>',null)
|
|
|
|
|
->get()
|
|
->get()
|
|
|
->toarray();
|
|
->toarray();
|
|
|
if(!$data[$k]['match_info']){
|
|
if(!$data[$k]['match_info']){
|
|
@@ -436,6 +434,8 @@ class MatchList extends Controller {
|
|
|
->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
|
->where($st_league.'.source',$this->source)
|
|
->where($st_league.'.source',$this->source)
|
|
|
->where([])
|
|
->where([])
|
|
|
|
|
+ ->where($st_competition.'.home_team','<>',null)
|
|
|
|
|
+ ->where($st_competition.'.guest_team','<>',null)
|
|
|
->get()
|
|
->get()
|
|
|
->toArray();
|
|
->toArray();
|
|
|
//洲下所有联赛
|
|
//洲下所有联赛
|
|
@@ -448,6 +448,8 @@ class MatchList extends Controller {
|
|
|
->where($st_league.'.source',$this->source)
|
|
->where($st_league.'.source',$this->source)
|
|
|
->where()
|
|
->where()
|
|
|
->where([])
|
|
->where([])
|
|
|
|
|
+ ->where($st_competition.'.home_team','<>',null)
|
|
|
|
|
+ ->where($st_competition.'.guest_team','<>',null)
|
|
|
->get()
|
|
->get()
|
|
|
->toArray();
|
|
->toArray();
|
|
|
//统计国家联赛下的赛事.
|
|
//统计国家联赛下的赛事.
|
|
@@ -464,7 +466,9 @@ class MatchList extends Controller {
|
|
|
$country[$k]['league_count'][$kk]['count'] = lm($st_competition, 'Sports')
|
|
$country[$k]['league_count'][$kk]['count'] = lm($st_competition, 'Sports')
|
|
|
->where($this->source)
|
|
->where($this->source)
|
|
|
->where('lg_id',$vv['lg_id'])
|
|
->where('lg_id',$vv['lg_id'])
|
|
|
- ->count();
|
|
|
|
|
|
|
+ ->where($st_competition.'.home_team','<>',null)
|
|
|
|
|
+ ->where($st_competition.'.guest_team','<>',null)
|
|
|
|
|
+ ->count('*');
|
|
|
if($country[$k]['league_count'][$kk]['count'] == 0){
|
|
if($country[$k]['league_count'][$kk]['count'] == 0){
|
|
|
unset($country[$k]['league_count'][$kk]);
|
|
unset($country[$k]['league_count'][$kk]);
|
|
|
}
|
|
}
|
|
@@ -485,7 +489,9 @@ class MatchList extends Controller {
|
|
|
$area[$k]['league_count'][$kk]['count'] = lm($st_competition, 'Sports')
|
|
$area[$k]['league_count'][$kk]['count'] = lm($st_competition, 'Sports')
|
|
|
->where($this->source)
|
|
->where($this->source)
|
|
|
->where('lg_id',$vv['lg_id'])
|
|
->where('lg_id',$vv['lg_id'])
|
|
|
- ->count();
|
|
|
|
|
|
|
+ ->where($st_competition.'.home_team','<>',null)
|
|
|
|
|
+ ->where($st_competition.'.guest_team','<>',null)
|
|
|
|
|
+ ->count('*');
|
|
|
if($area[$k]['league_count'][$kk]['count'] == 0){
|
|
if($area[$k]['league_count'][$kk]['count'] == 0){
|
|
|
unset($area[$k]['league_count'][$kk]);
|
|
unset($area[$k]['league_count'][$kk]);
|
|
|
}
|
|
}
|
|
@@ -558,7 +564,8 @@ class MatchList extends Controller {
|
|
|
->where($st_league.'.source',$this->source)
|
|
->where($st_league.'.source',$this->source)
|
|
|
->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
|
->where('country_id', $v['region_id'])
|
|
->where('country_id', $v['region_id'])
|
|
|
- ->get()->toarray();
|
|
|
|
|
|
|
+ ->get()
|
|
|
|
|
+ ->toarray();
|
|
|
}
|
|
}
|
|
|
foreach ($country as $k => $v) {
|
|
foreach ($country as $k => $v) {
|
|
|
foreach($v['league_count'] as $kk => $vv ){
|
|
foreach($v['league_count'] as $kk => $vv ){
|
|
@@ -568,7 +575,9 @@ class MatchList extends Controller {
|
|
|
->where('lg_id',$vv['lg_id'])
|
|
->where('lg_id',$vv['lg_id'])
|
|
|
->where('status', '<', '2')
|
|
->where('status', '<', '2')
|
|
|
->where('us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
->where('us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
- ->count();
|
|
|
|
|
|
|
+ ->where($st_competition.'.home_team','<>',null)
|
|
|
|
|
+ ->where($st_competition.'.guest_team','<>',null)
|
|
|
|
|
+ ->count('*');
|
|
|
if($country[$k]['league_count'][$kk]['count'] == 0){
|
|
if($country[$k]['league_count'][$kk]['count'] == 0){
|
|
|
unset($country[$k]['league_count'][$kk]);
|
|
unset($country[$k]['league_count'][$kk]);
|
|
|
}
|
|
}
|
|
@@ -584,17 +593,20 @@ class MatchList extends Controller {
|
|
|
->where($this->source)
|
|
->where($this->source)
|
|
|
->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
|
->where('area_id', $v['region_id'])
|
|
->where('area_id', $v['region_id'])
|
|
|
- ->get()->toarray();
|
|
|
|
|
|
|
+ ->get()
|
|
|
|
|
+ ->toarray();
|
|
|
}
|
|
}
|
|
|
foreach ($area as $k => $v) {
|
|
foreach ($area as $k => $v) {
|
|
|
foreach($v['league_count'] as $kk => $vv ){
|
|
foreach($v['league_count'] as $kk => $vv ){
|
|
|
$area[$k]['league_count'][$kk]['count'] = lm($st_competition, 'Sports')
|
|
$area[$k]['league_count'][$kk]['count'] = lm($st_competition, 'Sports')
|
|
|
->where($this->source)
|
|
->where($this->source)
|
|
|
->where($where)
|
|
->where($where)
|
|
|
|
|
+ ->where($st_competition.'.home_team','<>',null)
|
|
|
|
|
+ ->where($st_competition.'.guest_team','<>',null)
|
|
|
->where('status', '<', '2')
|
|
->where('status', '<', '2')
|
|
|
->where('us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
->where('us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
->where('lg_id',$vv['lg_id'])
|
|
->where('lg_id',$vv['lg_id'])
|
|
|
- ->count();
|
|
|
|
|
|
|
+ ->count('*');
|
|
|
if($area[$k]['league_count'][$kk]['count'] == 0){
|
|
if($area[$k]['league_count'][$kk]['count'] == 0){
|
|
|
unset($area[$k]['league_count'][$kk]);
|
|
unset($area[$k]['league_count'][$kk]);
|
|
|
}
|
|
}
|