瀏覽代碼

解决web版滚球球类数量数据异常

彭俊 6 年之前
父節點
當前提交
8e69b83c7a
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      Application/Sports/Controller/MatchListWeb.php

+ 7 - 2
Application/Sports/Controller/MatchListWeb.php

@@ -92,10 +92,15 @@ class MatchListWeb extends Controller{
             if($v['game_code'] !='gj'){
                 $models = $this->commonFunction->getModels($v['game_code'],1);
                 $where = $this->commonFunction->getState($type,$models['model_match']);
-                $matchNum = lm($models['model_league'],"Sports")
+                $matchData = lm($models['model_league'],"Sports")
                     ->join($models['model_match'],$models['model_match'].'.lg_id',$models['model_league'].'.id')
+                    ->select($models['model_match'].'.id as match_id')
                     ->where($where)
-                    ->count("*");
+                    ->get()
+                    ->toarray();
+                //===获取当前赛事是否有赔率,如果没有则去除===
+                $matchData_new = $this->commonFunction->Handle_Odds_Null($matchData,$models);
+                $matchNum = count($matchData_new);
                 //获取满足状态的球类
                 if($matchNum != 0){
                     $gameData[$k]['game_code'] = $v['game_code'];