Sfoglia il codice sorgente

追加web端滚球赔率状态

彭俊 6 anni fa
parent
commit
12e3bf74e4

+ 14 - 5
Application/Sports/Controller/MatchListWeb.php

@@ -282,13 +282,12 @@ where a.match_id = b.match_id and a.id = b.id ";
 
         //赔率数据
         $oddsCodeNum = $this->getOddsData($game_code,$models['model_odds'],$match_ids,$lg_ids,$p_code,$type);
-        
         if(empty($p_code) and $type != 'StRollBall') {
             return $oddsCodeNum;
         }
         
         //处理联赛/赛事/赔率 数据
-        $data = $this->get_l_m_o($p_code,$matchNum,$oddsCodeNum,$models['model_result_record'],$game_code);
+        $data = $this->get_l_m_o($p_code,$matchNum,$oddsCodeNum,$models['model_result_record'],$game_code,$type);
 
         return $data;
     }
@@ -296,8 +295,17 @@ where a.match_id = b.match_id and a.id = b.id ";
     /*
      * 联赛/赛事/赔率 组装数据
      */
-    public function get_l_m_o($p_code='',$matchData=[],$oddsCodeNum=[],$model_result_record='',$game_code=''){
+    public function get_l_m_o($p_code='',$matchData=[],$oddsCodeNum=[],$model_result_record='',$game_code='',$type=''){
+        //如果是滚球赔率 追加状态字段
+        if($type == 'StRollBall' and !empty($oddsCodeNum)){
+            $rollOdds = [];
+            foreach($oddsCodeNum as $k=>$v){
+                $v['oddsType'] = 'StRollBall';
+                $rollOdds[] = $v;
+            }
 
+            $oddsCodeNum = $rollOdds;
+        }
         $match_odds = [];
         //如果是冠军盘口
         if($p_code == 'kemp'){
@@ -457,6 +465,7 @@ where a.match_id = b.match_id and a.id = b.id ";
                 }
             }
         }
+
         //排序
         sort($match_odds);
         $data = [];
@@ -528,7 +537,7 @@ where a.match_id = b.match_id and a.id = b.id ";
             }else{
                 $whereOr = [['sort','=',0],['status','=',0],['is_stringscene','=',0]];
             }
-            $select = ['lg_id','match_id','id','p_code','odds_code','condition','odds','odds_only','sort','status','team'];
+            $select = ['lg_id','match_id','others_match_id','id','p_code','odds_code','condition','odds','odds_only','sort','status','team'];
             //获取冠军盘口
             if($p_code == 'kemp'){
                 $whereOr = [['sort','=',0],['type','=',1],['status','=',0]];
@@ -554,7 +563,7 @@ where a.match_id = b.match_id and a.id = b.id ";
         }
         //如果是滚球,则获取滚球下详细数据
         if($type == 'StRollBall'){
-            $select = ['lg_id','match_id','id','p_code','odds_code','condition','odds','odds_only','sort','status','team'];
+            $select = ['lg_id','match_id','others_match_id','id','p_code','odds_code','condition','odds','odds_only','sort','status','team'];
             $whereOr = [['sort','=',0],['status','=',0],['is_stringscene','=',0]];
             //获取滚球下,各球类默认玩法代码
             if($game_code == 'zq'){

+ 1 - 33
Application/Sports/Model/St_zq_odds.php

@@ -36,39 +36,6 @@ class St_zq_odds extends Model
                 ->toArray();
 
             return $oddsData;
-
-            /*
-            //获取各球类所有父级玩法
-            $p_code = lm('st_odds_code','Sports')
-            ->select('game_code','odds_code','odds_name')
-            ->where(['p_id'=>0,'game_code'=>$game_code])
-            ->get()
-            ->toArray();
-
-            //获取各状态下 各球类各父级盘口下赛事数量
-            $oddsData = lm($model_odds,"Sports")
-            // ->select($select)
-            ->whereIn('match_id',$match_ids)
-            ->where($whereOr)
-            ->pluck('p_code')
-            ->toArray();
-            $data = [];
-            foreach($p_code as $k=>$v){
-                foreach($oddsData as $kk=>$vv){
-                    if($v['odds_code'] == $vv){
-                        $data[$v['odds_code']][] = $vv;
-                    }
-                }
-            }
-            foreach($data as $k=>$v){
-                $data[$k]['game_code'] = $game_code;
-                $data[$k]['game_num'] = count($v);
-                $data[$k]['p_code'] = $k;
-                // $data[$k]['code_num'] = $game_code;
-            }
-
-            return $oddsData;
-            */
         }
         if($p_code == 'kemp'){
             $oddsData = lm($model_odds,"Sports")
@@ -86,6 +53,7 @@ class St_zq_odds extends Model
             ->where($whereOr)
             ->get()
             ->toArray();
+
         return $oddsData;
     }