|
@@ -128,8 +128,14 @@ class GetOddsData {
|
|
|
return $list;
|
|
return $list;
|
|
|
}
|
|
}
|
|
|
public function getOddsZQ($matchData,$model_odds,$source,$oddsTypeWhere=''){
|
|
public function getOddsZQ($matchData,$model_odds,$source,$oddsTypeWhere=''){
|
|
|
|
|
+ //获取赛事id 集合
|
|
|
|
|
+ $match_ids = [];
|
|
|
|
|
+ foreach ($matchData as $k=>$v){
|
|
|
|
|
+ $match_ids[] = (int)$v['match_id'];
|
|
|
|
|
+ }
|
|
|
$oddsData = lm($model_odds, 'Sports')
|
|
$oddsData = lm($model_odds, 'Sports')
|
|
|
->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
|
|
->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
|
|
|
|
|
+ ->whereIn('match_id',$match_ids)
|
|
|
->where($source)
|
|
->where($source)
|
|
|
->where(
|
|
->where(
|
|
|
function($query)use ($model_odds){
|
|
function($query)use ($model_odds){
|
|
@@ -206,9 +212,15 @@ class GetOddsData {
|
|
|
return $list;
|
|
return $list;
|
|
|
}
|
|
}
|
|
|
public function getOddsLQ($matchData,$model_odds,$source,$oddsTypeWhere=''){
|
|
public function getOddsLQ($matchData,$model_odds,$source,$oddsTypeWhere=''){
|
|
|
|
|
+ //获取赛事id 集合
|
|
|
|
|
+ $match_ids = [];
|
|
|
|
|
+ foreach ($matchData as $k=>$v){
|
|
|
|
|
+ $match_ids[] = $v['match_id'];
|
|
|
|
|
+ }
|
|
|
$oddsData = lm($model_odds, 'Sports')
|
|
$oddsData = lm($model_odds, 'Sports')
|
|
|
->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
|
|
->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
|
|
|
->where($source)
|
|
->where($source)
|
|
|
|
|
+ ->whereIn('match_id',$match_ids)
|
|
|
->where(
|
|
->where(
|
|
|
function($query)use ($model_odds){
|
|
function($query)use ($model_odds){
|
|
|
$query->where($model_odds.'.odds_code','concede_home')
|
|
$query->where($model_odds.'.odds_code','concede_home')
|
|
@@ -284,9 +296,15 @@ class GetOddsData {
|
|
|
return $list;
|
|
return $list;
|
|
|
}
|
|
}
|
|
|
public function getOddsWQ($matchData,$model_odds,$source,$oddsTypeWhere=''){
|
|
public function getOddsWQ($matchData,$model_odds,$source,$oddsTypeWhere=''){
|
|
|
|
|
+ //获取赛事id 集合
|
|
|
|
|
+ $match_ids = [];
|
|
|
|
|
+ foreach ($matchData as $k=>$v){
|
|
|
|
|
+ $match_ids[] = $v['match_id'];
|
|
|
|
|
+ }
|
|
|
$oddsData = lm($model_odds, 'Sports')
|
|
$oddsData = lm($model_odds, 'Sports')
|
|
|
->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
|
|
->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
|
|
|
->where($source)
|
|
->where($source)
|
|
|
|
|
+ ->whereIn('match_id',$match_ids)
|
|
|
->where(
|
|
->where(
|
|
|
function($query)use ($model_odds){
|
|
function($query)use ($model_odds){
|
|
|
$query->where($model_odds.'.odds_code','dishes_home')
|
|
$query->where($model_odds.'.odds_code','dishes_home')
|
|
@@ -355,9 +373,15 @@ class GetOddsData {
|
|
|
return $list;
|
|
return $list;
|
|
|
}
|
|
}
|
|
|
public function getOddsBQ($matchData,$model_odds,$source,$oddsTypeWhere=''){
|
|
public function getOddsBQ($matchData,$model_odds,$source,$oddsTypeWhere=''){
|
|
|
|
|
+ //获取赛事id 集合
|
|
|
|
|
+ $match_ids = [];
|
|
|
|
|
+ foreach ($matchData as $k=>$v){
|
|
|
|
|
+ $match_ids[] = $v['match_id'];
|
|
|
|
|
+ }
|
|
|
$oddsData = lm($model_odds, 'Sports')
|
|
$oddsData = lm($model_odds, 'Sports')
|
|
|
->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
|
|
->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
|
|
|
->where($source)
|
|
->where($source)
|
|
|
|
|
+ ->whereIn('match_id',$match_ids)
|
|
|
->where(
|
|
->where(
|
|
|
function($query)use ($model_odds){
|
|
function($query)use ($model_odds){
|
|
|
$query->where($model_odds.'.odds_code','capot_home')
|
|
$query->where($model_odds.'.odds_code','capot_home')
|