瀏覽代碼

异常处理

彭俊 6 年之前
父節點
當前提交
f579a46de1
共有 2 個文件被更改,包括 12 次插入33 次删除
  1. 1 0
      Application/Sports/Controller/MatchList.php
  2. 11 33
      Application/Sports/Controller/RollingBall.php

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

@@ -390,6 +390,7 @@ class  MatchList extends Controller {
                 if($type_code != 'StChampion'){
                     $matchNum = lm($matchModel['model_league'],"Sports")
                         ->join($matchModel['model_match'],$matchModel['model_match'].'.lg_id',$matchModel['model_league'].'.id')
+                        ->join($matchModel['model_odds'],$matchModel['model_odds'].'.match_id',$matchModel['model_match'].'.id')
                         ->where($where)
                         ->where([[$matchModel['model_league'].'.name_chinese','!=','']])
                         ->count("*");

+ 11 - 33
Application/Sports/Controller/RollingBall.php

@@ -30,15 +30,6 @@ class RollingBall extends Controller{
         //获取 滚球查询条件
         $where = $this->commonFunction->getState('StRollBall',$model_match);
 
-//        $result =lm($model_match,"Sports")
-//            ->join($model_result,$model_result.'.match_id',$model_match.'.id')
-//            ->join($model_league,$model_league.'.id',$model_match.'.lg_id')
-//            ->select($model_match.'.id as match_id',$model_match.'.tag','match_date as start_date',$model_match.'.match_time as start_time',$model_match.'.home_team',$model_match.'.guest_team','home_score','guest_score',$model_result.'.match_time','match_process')
-//            ->where([[$model_league.'.name_chinese','!=','']])
-//            ->where($where)
-//            ->get()
-//            ->toarray();
-
         $result =lm($model_match,"Sports")
             ->join($model_league,$model_league.'.id',$model_match.'.lg_id')
             ->select($model_match.'.id as match_id',$model_match.'.tag','match_date as start_date',$model_match.'.match_time as start_time',$model_match.'.home_team',$model_match.'.guest_team')
@@ -46,6 +37,8 @@ class RollingBall extends Controller{
             ->where($where)
             ->get()
             ->toarray();
+        //===获取当前赛事是否有赔率,如果没有则去除===
+        $result = $this->commonFunction->Handle_Odds_Null($result,$models);
         foreach ($result as $k=>$v){
             $v['home_score'] = 0;
             $v['guest_score'] = 0;
@@ -61,6 +54,7 @@ class RollingBall extends Controller{
             'matchData'=>$result
         ];
 
+        dd($data);
         return $data;
 
     }
@@ -77,14 +71,6 @@ class RollingBall extends Controller{
         $model_league = $models['model_league'];
         //获取 滚球查询条件
         $where = $this->commonFunction->getState('StRollBall',$model_match);
-//        $result =lm($model_match,"Sports")
-//            ->join($model_result,$model_result.'.match_id',$model_match.'.id')
-//            ->join($model_league,$model_league.'.id',$model_match.'.lg_id')
-//            ->select($model_match.'.id as match_id',$model_match.'.tag','match_date as start_date',$model_match.'.match_time as start_time',$model_match.'.home_team',$model_match.'.guest_team','home_score','guest_score',$model_result.'.match_time','match_process')
-//            ->where($where)
-//            ->where([[$model_league.'.name_chinese','!=','']])
-//            ->get()
-//            ->toarray();
         $result =lm($model_match,"Sports")
             ->join($model_league,$model_league.'.id',$model_match.'.lg_id')
             ->select($model_match.'.id as match_id',$model_match.'.tag','match_date as start_date',$model_match.'.match_time as start_time',$model_match.'.home_team',$model_match.'.guest_team')
@@ -92,6 +78,9 @@ class RollingBall extends Controller{
             ->where([[$model_league.'.name_chinese','!=','']])
             ->get()
             ->toarray();
+        
+         //===获取当前赛事是否有赔率,如果没有则去除===
+         $result = $this->commonFunction->Handle_Odds_Null($result,$models);
 
         foreach ($result as $k=>$v){
             $v['home_score'] = 0;
@@ -118,14 +107,6 @@ class RollingBall extends Controller{
         $model_league = $models['model_league'];
         //获取 滚球查询条件
         $where = $this->commonFunction->getState('StRollBall',$model_match);
-//        $result =lm($model_match,"Sports")
-//            ->join($model_result,$model_result.'.match_id',$model_match.'.id')
-//            ->join($model_league,$model_league.'.id',$model_match.'.lg_id')
-//            ->select($model_match.'.id as match_id',$model_match.'.tag','match_date as start_date',$model_match.'.match_time as start_time','home_player_name','guest_player_name','first_inning_score','second_inning_score','third_inning_score',$model_result.'.match_time','match_process')
-//            ->where($where)
-//            ->where([[$model_league.'.name_chinese','!=','']])
-//            ->get()
-//            ->toarray();
         $result =lm($model_match,"Sports")
             ->join($model_league,$model_league.'.id',$model_match.'.lg_id')
             ->select($model_match.'.id as match_id',$model_match.'.tag','match_date as start_date',$model_match.'.match_time as start_time',$model_match.'.home_team as home_player_name',$model_match.'.guest_team as guest_player_name')
@@ -134,6 +115,8 @@ class RollingBall extends Controller{
             ->get()
             ->toarray();
 
+         //===获取当前赛事是否有赔率,如果没有则去除===
+         $result = $this->commonFunction->Handle_Odds_Null($result,$models);
         foreach ($result as $k=>$v){
             $v['first_inning_score'] = 0;
             $v['second_inning_score'] = 0;
@@ -160,14 +143,7 @@ class RollingBall extends Controller{
         $model_league = $models['model_league'];
         //获取 滚球查询条件
         $where = $this->commonFunction->getState('StRollBall',$model_match);
-//        $result =lm($model_match,"Sports")
-//            ->join($model_result,$model_result.'.match_id',$model_match.'.id')
-//            ->join($model_league,$model_league.'.id',$model_match.'.lg_id')
-//            ->select($model_match.'.id as match_id',$model_match.'.tag','match_date as start_date',$model_match.'.match_time as start_time',$model_match.'.home_team',$model_match.'.guest_team','home_score','guest_score',$model_result.'.match_time','match_process')
-//            ->where($where)
-//            ->where([[$model_league.'.name_chinese','!=','']])
-//            ->get()
-//            ->toarray();
+
         $result =lm($model_match,"Sports")
             ->join($model_league,$model_league.'.id',$model_match.'.lg_id')
             ->select($model_match.'.id as match_id',$model_match.'.tag','match_date as start_date',$model_match.'.match_time as start_time',$model_match.'.home_team',$model_match.'.guest_team')
@@ -176,6 +152,8 @@ class RollingBall extends Controller{
             ->get()
             ->toarray();
 
+         //===获取当前赛事是否有赔率,如果没有则去除===
+         $result = $this->commonFunction->Handle_Odds_Null($result,$models);
         foreach ($result as $k=>$v){
             $v['home_score'] = 0;
             $v['guest_score'] = 0;