where($where)->groupby("lg_id","match_id","type")->get(); return $oddsData; } //获取赔率数据 用于pc端 public static function getOddsDataPC($model_odds='',$select=[],$match_ids=[],$whereOr=[],$p_code=[],$game_code=''){ if(empty($p_code)){ $oddsData = lm($model_odds,"Sports") ->select($select) ->whereIn('match_id',$match_ids) ->where($whereOr) ->get() ->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") ->select($select) ->whereIn('lg_id',$match_ids) ->where($whereOr) ->get() ->toArray(); return $oddsData; } $oddsData = lm($model_odds,"Sports") ->select($select) ->whereIn('match_id',$match_ids) ->whereIn('p_code',$p_code) ->where($whereOr) ->get() ->toArray(); return $oddsData; } //获取足球赛事下 滚球盘默认赔率 public static function getMatchOdds($source,$models,$match_ids=[]){ $model_odds = $models['model_odds']; $oddsData= lm($model_odds,"Sports") ->select($model_odds.'.match_id',$model_odds.'.id','p_code','odds_code',$model_odds.'.status','odds','condition','odds_only','sort') // ->where($model_odds.'.source',$source['source']) ->whereIn($model_odds.'.match_id',$match_ids) ->where([$model_odds.'.type'=>0,$model_odds.'.status'=>0])//查询滚球赔率 //->where($model_odds.'.expire_time','>',date("Y-m-d H:i:s")) ->where(function($query)use ($model_odds){ $query->where($model_odds.'.odds_code','concede_home') ->orWhere(function($query)use ($model_odds){ $query->where($model_odds.'.odds_code','concede_guest'); }) ->orWhere(function($query)use ($model_odds){ $query->where($model_odds.'.odds_code','goal_size_big'); }) ->orWhere(function($query)use ($model_odds){ $query->where($model_odds.'.odds_code','goal_size_small'); }) ->orWhere(function($query)use ($model_odds){ $query->where($model_odds.'.odds_code','capot_home'); }) ->orWhere(function($query)use ($model_odds){ $query->where($model_odds.'.odds_code','capot_dogfall'); }) ->orWhere(function($query)use ($model_odds){ $query->where($model_odds.'.odds_code','capot_guest'); }); }) ->get() ->toarray(); return $oddsData; } }