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

解决首页 各球类参赛表数据异常

彭俊 6 жил өмнө
parent
commit
40eb085ba4

+ 22 - 17
Application/Sports/Controller/MatchList.php

@@ -842,23 +842,28 @@ where a.match_id = b.match_id and a.id = b.id ";
 
         //查询今日赛事
         $dataCount = lm($st_competition,'Sports')
-            ->join($st_league,$st_league.'.id',$st_competition.'.lg_id')
-            ->leftjoin('st_area_country as country','country.id',$st_league.'.country_id')
-            ->leftjoin('st_area_country as area','area.id',$st_league.'.area_id')
-            ->where($where)
-            ->where($Orwhere)
-            ->where($where_search)
-            ->where([
-                [$st_competition.'.home_team','<>',null],
-                [$st_competition.'.guest_team','<>',null],
-                [$st_league.'.name_chinese','<>',null],
-                [$st_competition.'.status','<',2],
-                [$st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4)]
-            ])
-            ->distinct($st_competition.'.id')
-            ->count('*');
-
-        return $dataCount;
+        ->join($st_league,$st_league.'.id',$st_competition.'.lg_id')
+        ->leftjoin('st_area_country as country','country.id',$st_league.'.country_id')
+        ->leftjoin('st_area_country as area','area.id',$st_league.'.area_id')
+        ->select($st_competition.'.id as match_id')
+        ->where($where)
+        ->where($Orwhere)
+        ->where($where_search)
+        ->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)]
+        ])
+        ->distinct($st_competition.'.id')
+        ->get()->toArray();
+
+        //===获取当前赛事是否有赔率,如果没有则去除===
+        $dataCount = $this->commonFunction->Handle_Odds_Null($dataCount,$getModels);
+
+
+        return count($dataCount);
     }
 
 }