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

+ 1 - 1
Application/Sports/Controller/MatchList.php

@@ -264,7 +264,7 @@ class  MatchList extends Controller {
         //洲下所有联赛
         $select=['st_area_country.id as region_id','st_area_country.name as region',$st_league.'.id as lg_id',$st_league.'.country_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);
+        $data['info'] = array_merge($country=[],$area=[]);
         Render($data, '1', lang('Tips','Sports')->get('success'));
     }
     /**

+ 13 - 13
Application/Sports/Controller/MatchListWeb.php

@@ -38,7 +38,7 @@ class MatchListWeb extends Controller{
         try {
             if(empty($type) ){
                 throw new \Exception(Render([], '10001', lang('Tips','Sports')->get('PARAM_ERROR')));
-            }
+            } 
             //如果有lg_id,则将其转为数组
             if(!empty($lg_ids)){
                 if(strstr($lg_ids,',') != false){
@@ -135,7 +135,7 @@ class MatchListWeb extends Controller{
         foreach ($game as $k=>$v) {
             if ($v['game_code'] != 'gj') {
                 //获取各球类下父级玩法赛事数量
-                $oddsCodeNum[$k] = $this->getMatchData($type,$v['game_code'],'');
+                $oddsCodeNum[$k] = $this->getMatchData($type,$v['game_code'],'','','',$search);
             }
         }
 
@@ -197,17 +197,17 @@ class MatchListWeb extends Controller{
                 ->get()->toArray();
         }else{
             $matchData = lm($models['model_league'],"Sports")
-                ->join($model_match,$model_match.'.lg_id',$models['model_league'].'.id')
-                ->select($select)
-                ->where($where)//状态条件
-                ->where($timeWhere)//时间条件
-                ->where(function($query)use ($model_match,$search){//追加 球队搜索
-                    $query->where($model_match.'.home_team','like','%'.$search.'%')
-                        ->orWhere(function($query)use ($model_match,$search) {
-                            $query->where($model_match . '.guest_team', 'like', '%' . $search . '%');
-                        });
-                })
-                ->get()->toArray();
+            ->join($model_match,$model_match.'.lg_id',$models['model_league'].'.id')
+            ->select($select)
+            ->where($where)//状态条件
+            ->where($timeWhere)//时间条件
+            ->where(function($query)use ($model_match,$search){//追加 球队搜索
+                $query->where($model_match.'.home_team','like','%'.$search.'%')
+                    ->orWhere(function($query)use ($model_match,$search) {
+                        $query->where($model_match . '.guest_team', 'like', '%' . $search . '%');
+                    });
+            })
+            ->get()->toArray();
         }
 
         //不是冠军,则验证赛事赔率