Эх сурвалжийг харах

解决首页各球类入口联赛数据统计异常

彭俊 6 жил өмнө
parent
commit
a5ff47caea

+ 5 - 2
Application/Sports/Controller/MatchList.php

@@ -259,10 +259,10 @@ class  MatchList extends Controller {
             ->where('game_code',$gameType)
             ->value('game_name');
         //国家联赛数据
-        $select=['st_area_country.id as region_id','st_area_country.name as region',$st_league.'.id as lg_id',$st_league.'.name_chinese as league'];
+        $select=['st_area_country.id as region_id','st_area_country.name as region',$st_league.'.id as lg_id',$st_league.'.name_chinese as league',$st_competition.'.id as match_id'];
         $country = $this->getRegionInfo($where,$search,$select,'st_area_country','id','country_id',$gameType);
         //洲下所有联赛
-        $select=['st_area_country.id as region_id','st_area_country.name as region',$st_league.'.id as lg_id',$st_league.'.name_chinese as league'];
+        $select=['st_area_country.id as region_id','st_area_country.name as region',$st_league.'.id as lg_id',$st_league.'.name_chinese as league',$st_competition.'.id as match_id'];
         $area = $this->getRegionInfo($where,$search,$select,'st_area_country','id','area_id',$gameType);
         $data['info'] = array_merge($country,$area);
         Render($data, '1', lang('Tips','Sports')->get('success'));
@@ -297,6 +297,8 @@ class  MatchList extends Controller {
                 ])
                 ->get()
                 ->toArray();
+            //===获取当前赛事是否有赔率,如果没有则去除===
+            $regionInfo = $this->commonFunction->Handle_Odds_Null($regionInfo,$getModels);
             //地区分割
             $info = [];
             foreach($regionInfo as $k => $v){
@@ -327,6 +329,7 @@ class  MatchList extends Controller {
                         }
                     }
                 }
+                sort($info[$key]['league_count']);
             }
             return $info;
         } catch (\Exception $e) {