|
@@ -328,7 +328,6 @@ class GetmatchData {
|
|
|
*/
|
|
*/
|
|
|
public function getToday($source,$models,$where,$lg_id=0,$search='',$oddsTypeWhere=[]){
|
|
public function getToday($source,$models,$where,$lg_id=0,$search='',$oddsTypeWhere=[]){
|
|
|
//获取model
|
|
//获取model
|
|
|
-
|
|
|
|
|
$model_match = $models['model_match'];
|
|
$model_match = $models['model_match'];
|
|
|
$model_odds = $models['model_odds'];
|
|
$model_odds = $models['model_odds'];
|
|
|
$model_league = $models['model_league'];
|
|
$model_league = $models['model_league'];
|
|
@@ -398,14 +397,10 @@ class GetmatchData {
|
|
|
if($lg_id >0){
|
|
if($lg_id >0){
|
|
|
$last_time = lm($model_league, 'Sports')
|
|
$last_time = lm($model_league, 'Sports')
|
|
|
->select('last_time')
|
|
->select('last_time')
|
|
|
-// ->where($model_odds.'.expire_time','>',date("Y-m-d H:i:s"))
|
|
|
|
|
-// ->where($source)
|
|
|
|
|
->where('id',$lg_id)
|
|
->where('id',$lg_id)
|
|
|
->first()->last_time;
|
|
->first()->last_time;
|
|
|
$championData = lm($model_odds, 'Sports')
|
|
$championData = lm($model_odds, 'Sports')
|
|
|
->select("id","lg_id","match_id","p_code","odds_code","team","odds","sort","status","odds_only")
|
|
->select("id","lg_id","match_id","p_code","odds_code","team","odds","sort","status","odds_only")
|
|
|
-// ->where($model_odds.'.expire_time','>',date("Y-m-d H:i:s"))
|
|
|
|
|
-// ->where($source)
|
|
|
|
|
->where('lg_id',$lg_id)
|
|
->where('lg_id',$lg_id)
|
|
|
->where($where)
|
|
->where($where)
|
|
|
->groupBy("id","lg_id","match_id","p_code","odds_code","team","odds","sort","status","odds_only")
|
|
->groupBy("id","lg_id","match_id","p_code","odds_code","team","odds","sort","status","odds_only")
|
|
@@ -440,10 +435,8 @@ class GetmatchData {
|
|
|
$country = lm($model_league,"Sports")
|
|
$country = lm($model_league,"Sports")
|
|
|
->leftjoin('st_area_country','st_area_country.id',$model_league.'.country_id')
|
|
->leftjoin('st_area_country','st_area_country.id',$model_league.'.country_id')
|
|
|
->select('st_area_country.id as country_id','st_area_country.name as region')
|
|
->select('st_area_country.id as country_id','st_area_country.name as region')
|
|
|
-// ->select('st_country.country_id as region_id','st_country.name_chinese as region',$model_league.'.lg_id', $model_league.'.name_chinese as league')
|
|
|
|
|
->distinct('st_area_country.name')
|
|
->distinct('st_area_country.name')
|
|
|
->where([[$model_league.'.name_chinese','!=','']])
|
|
->where([[$model_league.'.name_chinese','!=','']])
|
|
|
-// ->where($model_league.'.source',$source['source'])
|
|
|
|
|
->where($model_league.'.name_chinese','like','%'.$search.'%')
|
|
->where($model_league.'.name_chinese','like','%'.$search.'%')
|
|
|
->get()
|
|
->get()
|
|
|
->toArray();
|
|
->toArray();
|
|
@@ -451,10 +444,8 @@ class GetmatchData {
|
|
|
$area = lm($model_league,"Sports")
|
|
$area = lm($model_league,"Sports")
|
|
|
->leftjoin('st_area_country','st_area_country.id',$model_league.'.area_id')
|
|
->leftjoin('st_area_country','st_area_country.id',$model_league.'.area_id')
|
|
|
->select('st_area_country.id as area_id','st_area_country.name as region')
|
|
->select('st_area_country.id as area_id','st_area_country.name as region')
|
|
|
-// ->select('st_area.id as region_id','st_area.title as region',$model_league.'.lg_id', $model_league.'.name_chinese as league')
|
|
|
|
|
->distinct('st_area_country.name')
|
|
->distinct('st_area_country.name')
|
|
|
->where([[$model_league.'.name_chinese','!=','']])
|
|
->where([[$model_league.'.name_chinese','!=','']])
|
|
|
-// ->where($model_league.'.source',$source['source'])
|
|
|
|
|
->where($model_league.'.name_chinese','like','%'.$search.'%')
|
|
->where($model_league.'.name_chinese','like','%'.$search.'%')
|
|
|
->get()
|
|
->get()
|
|
|
->toArray();
|
|
->toArray();
|
|
@@ -476,7 +467,6 @@ class GetmatchData {
|
|
|
public function getMatchNum($source,$country,$area,$model_league,$model_match='',$model_odds='',$where,$search,$time='',$type=0){
|
|
public function getMatchNum($source,$country,$area,$model_league,$model_match='',$model_odds='',$where,$search,$time='',$type=0){
|
|
|
$leagueData = lm($model_league,'Sports')
|
|
$leagueData = lm($model_league,'Sports')
|
|
|
->select('id as lg_id','name_chinese as league','country_id','area_id')
|
|
->select('id as lg_id','name_chinese as league','country_id','area_id')
|
|
|
-// ->where($source)
|
|
|
|
|
->where([[$model_league.'.name_chinese','!=','']])
|
|
->where([[$model_league.'.name_chinese','!=','']])
|
|
|
->where($model_league.'.name_chinese','like','%'.$search.'%')
|
|
->where($model_league.'.name_chinese','like','%'.$search.'%')
|
|
|
->get()
|
|
->get()
|
|
@@ -493,7 +483,6 @@ class GetmatchData {
|
|
|
$matchData = lm($model_match,'Sports')
|
|
$matchData = lm($model_match,'Sports')
|
|
|
->select('id as match_id','lg_id')
|
|
->select('id as match_id','lg_id')
|
|
|
->where($where)
|
|
->where($where)
|
|
|
-// ->where($source)
|
|
|
|
|
->where($timeWhere)
|
|
->where($timeWhere)
|
|
|
->get()
|
|
->get()
|
|
|
->toArray();
|
|
->toArray();
|
|
@@ -530,7 +519,6 @@ class GetmatchData {
|
|
|
if($v['area_id'] == $vv['area_id']){
|
|
if($v['area_id'] == $vv['area_id']){
|
|
|
$areaData[$k]['league_count'][] = $vv;
|
|
$areaData[$k]['league_count'][] = $vv;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -556,7 +544,6 @@ class GetmatchData {
|
|
|
|
|
|
|
|
$leagueData = lm($model_league,'Sports')
|
|
$leagueData = lm($model_league,'Sports')
|
|
|
->select('id as lg_id','name_chinese as league','country_id','area_id')
|
|
->select('id as lg_id','name_chinese as league','country_id','area_id')
|
|
|
-// ->where($source)
|
|
|
|
|
->where([[$model_league.'.name_chinese','!=','']])
|
|
->where([[$model_league.'.name_chinese','!=','']])
|
|
|
->where($model_league.'.name_chinese','like','%'.$search.'%')
|
|
->where($model_league.'.name_chinese','like','%'.$search.'%')
|
|
|
->get()
|
|
->get()
|
|
@@ -566,7 +553,6 @@ class GetmatchData {
|
|
|
->select('id','lg_id','p_code')
|
|
->select('id','lg_id','p_code')
|
|
|
->distinct("p_code")//去重
|
|
->distinct("p_code")//去重
|
|
|
->where($where)
|
|
->where($where)
|
|
|
-// ->where($source)
|
|
|
|
|
->get()
|
|
->get()
|
|
|
->toArray();
|
|
->toArray();
|
|
|
|
|
|
|
@@ -626,7 +612,6 @@ class GetmatchData {
|
|
|
public function getMatchOdds($source,$model_league,$model_match,$model_odds,$where,$search,$lg_id,$time='',$oddsTypeWhere=[]){
|
|
public function getMatchOdds($source,$model_league,$model_match,$model_odds,$where,$search,$lg_id,$time='',$oddsTypeWhere=[]){
|
|
|
$leagueData = lm($model_league,"Sports")
|
|
$leagueData = lm($model_league,"Sports")
|
|
|
->select('id as lg_id','name_chinese as leagueName')
|
|
->select('id as lg_id','name_chinese as leagueName')
|
|
|
-// ->where($source)
|
|
|
|
|
->where('id',$lg_id)
|
|
->where('id',$lg_id)
|
|
|
->first();
|
|
->first();
|
|
|
//根据时间 拼装查询条件
|
|
//根据时间 拼装查询条件
|
|
@@ -655,7 +640,6 @@ class GetmatchData {
|
|
|
|
|
|
|
|
$matchData = lm($model_match,"Sports")
|
|
$matchData = lm($model_match,"Sports")
|
|
|
->select($model_match.'.id as match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team')
|
|
->select($model_match.'.id as match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team')
|
|
|
-// ->where($source)
|
|
|
|
|
->where($model_match.'.lg_id',$lg_id)
|
|
->where($model_match.'.lg_id',$lg_id)
|
|
|
->where($where)
|
|
->where($where)
|
|
|
->where($whereTime)
|
|
->where($whereTime)
|
|
@@ -709,7 +693,6 @@ class GetmatchData {
|
|
|
|
|
|
|
|
$matchData = lm($model['model_match'], 'Sports')
|
|
$matchData = lm($model['model_match'], 'Sports')
|
|
|
->select('id as match_id','home_team','guest_team','match_time','us_time')
|
|
->select('id as match_id','home_team','guest_team','match_time','us_time')
|
|
|
-// ->where($source)
|
|
|
|
|
->where($where)
|
|
->where($where)
|
|
|
->orderBy('match_time','asc')
|
|
->orderBy('match_time','asc')
|
|
|
->get()->toArray();
|
|
->get()->toArray();
|
|
@@ -748,7 +731,6 @@ class GetmatchData {
|
|
|
$model_league = $model['model_league'];
|
|
$model_league = $model['model_league'];
|
|
|
$leagueData = lm($model_league,'Sports')
|
|
$leagueData = lm($model_league,'Sports')
|
|
|
->select('name_chinese','id as lg_id','last_time')
|
|
->select('name_chinese','id as lg_id','last_time')
|
|
|
-// ->where($model_league.'.source',$source['source'])
|
|
|
|
|
->where($model_league.'.name_chinese','欧洲冠军杯')
|
|
->where($model_league.'.name_chinese','欧洲冠军杯')
|
|
|
->first();
|
|
->first();
|
|
|
//获取滚球数据
|
|
//获取滚球数据
|
|
@@ -800,7 +782,6 @@ class GetmatchData {
|
|
|
$matchData = lm($model_match,"Sports")
|
|
$matchData = lm($model_match,"Sports")
|
|
|
->leftjoin($model_result,$model_result.'.match_id',$model_match.'.id')
|
|
->leftjoin($model_result,$model_result.'.match_id',$model_match.'.id')
|
|
|
->select($model_match.'.id as match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team','home_score','guest_score',$model_result.'.match_time as a_time','match_process')
|
|
->select($model_match.'.id as match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team','home_score','guest_score',$model_result.'.match_time as a_time','match_process')
|
|
|
-// ->where($model_match.'.source',$source['source'])
|
|
|
|
|
->where($model_match.'.lg_id',$lg_id)
|
|
->where($model_match.'.lg_id',$lg_id)
|
|
|
->where($where)
|
|
->where($where)
|
|
|
->where(function($query)use ($model_match,$search){
|
|
->where(function($query)use ($model_match,$search){
|
|
@@ -848,7 +829,6 @@ class GetmatchData {
|
|
|
$where = $this->commonFunction->getState($type_code);
|
|
$where = $this->commonFunction->getState($type_code);
|
|
|
$matchData = lm($model_match,'Sports')
|
|
$matchData = lm($model_match,'Sports')
|
|
|
->select('id as match_id','match_date','match_time','tag','home_team','guest_team')
|
|
->select('id as match_id','match_date','match_time','tag','home_team','guest_team')
|
|
|
-// ->where($model_match.'.source',$source['source'])
|
|
|
|
|
->where($where)
|
|
->where($where)
|
|
|
->where('lg_id',$lg_id)
|
|
->where('lg_id',$lg_id)
|
|
|
->where(function($query)use ($model_match,$search){
|
|
->where(function($query)use ($model_match,$search){
|
|
@@ -867,7 +847,6 @@ class GetmatchData {
|
|
|
//获取赔率数据
|
|
//获取赔率数据
|
|
|
$oddsData = lm($model_odds, "Sports")
|
|
$oddsData = lm($model_odds, "Sports")
|
|
|
->select( 'id','p_code', 'odds_code','odds_only','status', 'odds', 'condition', 'sort','match_id')
|
|
->select( 'id','p_code', 'odds_code','odds_only','status', 'odds', 'condition', 'sort','match_id')
|
|
|
-// ->where('source',$source['source'])
|
|
|
|
|
->whereIn('match_id', $match_ids)
|
|
->whereIn('match_id', $match_ids)
|
|
|
->groupBy($model_odds . '.id','p_code', 'odds_code','odds_only', $model_odds . '.status', 'odds', 'condition', 'sort','match_id')
|
|
->groupBy($model_odds . '.id','p_code', 'odds_code','odds_only', $model_odds . '.status', 'odds', 'condition', 'sort','match_id')
|
|
|
->orderBy($model_odds . '.id','desc')
|
|
->orderBy($model_odds . '.id','desc')
|
|
@@ -894,7 +873,6 @@ class GetmatchData {
|
|
|
|
|
|
|
|
$matchData = lm($model_match,'Sports')
|
|
$matchData = lm($model_match,'Sports')
|
|
|
->select('id as match_id','match_date','match_time','tag','home_team','guest_team')
|
|
->select('id as match_id','match_date','match_time','tag','home_team','guest_team')
|
|
|
-// ->where($model_match.'.source',$source['source'])
|
|
|
|
|
->where($where)
|
|
->where($where)
|
|
|
->where('lg_id',$lg_id)
|
|
->where('lg_id',$lg_id)
|
|
|
->where(function($query)use ($model_match,$search){
|
|
->where(function($query)use ($model_match,$search){
|
|
@@ -919,8 +897,6 @@ class GetmatchData {
|
|
|
$where = $this->commonFunction->getState($type_code);
|
|
$where = $this->commonFunction->getState($type_code);
|
|
|
$championData = lm($model_odds, 'Sports')
|
|
$championData = lm($model_odds, 'Sports')
|
|
|
->select("id","lg_id","match_id","p_code","odds_code","team","odds","sort","status","odds_only")
|
|
->select("id","lg_id","match_id","p_code","odds_code","team","odds","sort","status","odds_only")
|
|
|
-// ->where($model_odds.'.expire_time','>',date("Y-m-d H:i:s"))
|
|
|
|
|
-// ->where($source)
|
|
|
|
|
->where('lg_id',$lg_id)
|
|
->where('lg_id',$lg_id)
|
|
|
->where($where)
|
|
->where($where)
|
|
|
->groupBy("id","lg_id","match_id","p_code","odds_code","team","odds","sort","status","odds_only")
|
|
->groupBy("id","lg_id","match_id","p_code","odds_code","team","odds","sort","status","odds_only")
|