|
|
@@ -28,91 +28,57 @@ class MatchList extends Controller {
|
|
|
private function zq_participate (){
|
|
|
$data['type'] = '足球';
|
|
|
$data['game_code'] = 'zq';
|
|
|
+ $where_search = [];
|
|
|
//查询今日赛事
|
|
|
+ $where = $this->commonFunction->getState('StToday');
|
|
|
+ $Orwhere = [];
|
|
|
$data['info'][0]['name'] = '今日赛事';
|
|
|
$data['info'][0]['code'] = 'today';
|
|
|
- $data['info'][0]['count'] = lm('st_zq_competition','Sports')
|
|
|
- ->join('st_zq_league','st_zq_league.lg_id','st_zq_competition.lg_id')
|
|
|
- ->where($this->commonFunction->getState('StToday'))
|
|
|
- ->where('st_zq_competition.source',$this->source['source'])
|
|
|
- ->where('st_zq_competition.home_team','<>',null)
|
|
|
- ->where('st_zq_competition.guest_team','<>',null)
|
|
|
- ->distinct('st_zq_competition.match_id')
|
|
|
- ->count('*');
|
|
|
+ $data['info'][0]['count'] = $this->getMatchCount($where,$Orwhere,$where_search,$data['game_code']);
|
|
|
+
|
|
|
//查询明日赛事
|
|
|
+ $where=[['st_zq_competition.match_date','tomorrow']];
|
|
|
+ $Orwhere=[];
|
|
|
$data['info'][1]['name'] = '明日赛事';
|
|
|
$data['info'][1]['code'] = 'tomorrow';
|
|
|
- $data['info'][1]['count'] = lm('st_zq_competition','Sports')
|
|
|
- ->join('st_zq_league','st_zq_league.lg_id','st_zq_competition.lg_id')
|
|
|
- ->where('st_zq_competition.source',$this->source['source'])
|
|
|
- ->where('st_zq_competition.match_date','tomorrow')
|
|
|
- ->where('st_zq_competition.home_team','<>',null)
|
|
|
- ->where('st_zq_competition.guest_team','<>',null)
|
|
|
- ->count('*');
|
|
|
+ $data['info'][1]['count'] = $this->getMatchCount($where,$Orwhere,$where_search,$data['game_code']);
|
|
|
+
|
|
|
//受欢迎的欧洲赛事
|
|
|
+ $where =[['area.name_en','Europe'],['st_zq_league.hot',0]];
|
|
|
+ $Orwhere=[];
|
|
|
$data['info'][2]['name'] = '受欢迎的欧洲赛事';
|
|
|
$data['info'][2]['code'] = 'popular';
|
|
|
- $data['info'][2]['count'] = lm('st_zq_competition','Sports')
|
|
|
- ->join('st_zq_league','st_zq_league.lg_id','st_zq_competition.lg_id')
|
|
|
- ->join('st_area','st_area.id','st_zq_league.area_id')
|
|
|
- ->where('st_area.code',"Europe")
|
|
|
- ->where('st_zq_league.hot',0)
|
|
|
- ->where('st_zq_competition.status','<',2)
|
|
|
- ->where('st_zq_competition.us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
- ->where('st_zq_competition.source',$this->source['source'])
|
|
|
- ->where('st_zq_competition.home_team','<>',null)
|
|
|
- ->where('st_zq_competition.guest_team','<>',null)
|
|
|
- ->count('*');
|
|
|
+ $data['info'][2]['count'] = $this->getMatchCount($where,$Orwhere,$where_search,$data['game_code']);
|
|
|
|
|
|
//查询亚洲,澳洲赛事
|
|
|
+ $where =[];
|
|
|
+ $Orwhere = function ($query) {
|
|
|
+ $query->Orwhere('area.name_en','=','Asia')
|
|
|
+ ->Orwhere('country.name_en','=','Australia');
|
|
|
+ };
|
|
|
$data['info'][3]['name'] = '亚洲/澳洲赛事';
|
|
|
$data['info'][3]['code'] = 'asia_aus';
|
|
|
- $data['info'][3]['count'] = lm('st_zq_competition','Sports')
|
|
|
- ->join('st_zq_league','st_zq_league.lg_id','st_zq_competition.lg_id')
|
|
|
- ->leftjoin('st_country','st_country.country_id','st_zq_league.country_id')
|
|
|
- ->leftjoin('st_area','st_area.id','st_zq_league.area_id')
|
|
|
- ->select('match_id')
|
|
|
- ->where(function ($query) {
|
|
|
- $query->Orwhere('st_area.code','=','Asian')
|
|
|
- ->Orwhere('st_country.name_english','=','Australia');
|
|
|
- })
|
|
|
- ->where('st_zq_competition.status','<',2)
|
|
|
- ->where('st_zq_competition.us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
- ->where('st_zq_competition.source',$this->source['source'])
|
|
|
- ->where('st_zq_competition.home_team','<>',null)
|
|
|
- ->where('st_zq_competition.guest_team','<>',null)
|
|
|
- ->count('*');
|
|
|
+ $data['info'][3]['count'] = $this->getMatchCount($where,$Orwhere,$where_search,$data['game_code']);
|
|
|
+
|
|
|
//查询北美,南美赛事
|
|
|
+ $where = [];
|
|
|
+ $Orwhere = function ($query) {
|
|
|
+ $query->Orwhere('area.name_en','=', "South America")
|
|
|
+ ->Orwhere('area.name_en','=', "North America");
|
|
|
+ };
|
|
|
$data['info'][4]['name'] = '北美/南美赛事';
|
|
|
$data['info'][4]['code'] = 'south_north';
|
|
|
- $data['info'][4]['count'] = lm('st_zq_competition','Sports')
|
|
|
- ->join('st_zq_league','st_zq_league.lg_id','st_zq_competition.lg_id')
|
|
|
- ->join('st_area','st_area.id','st_zq_league.area_id')
|
|
|
- ->where(function ($query) {
|
|
|
- $query->Orwhere('st_area.code','=', "South_America")
|
|
|
- ->Orwhere('st_area.code','=', "North_America");
|
|
|
- })
|
|
|
- ->where('st_zq_competition.status', '<', '2')
|
|
|
- ->where('st_zq_competition.us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
- ->where('st_area.source',$this->source['source'])
|
|
|
- ->where('st_zq_competition.home_team','<>',null)
|
|
|
- ->where('st_zq_competition.guest_team','<>',null)
|
|
|
- ->count('*');
|
|
|
+ $data['info'][4]['count'] = $this->getMatchCount($where,$Orwhere,$where_search,$data['game_code']);
|
|
|
+
|
|
|
//国际赛事
|
|
|
+ $where = [['area.name_en',"world"]];
|
|
|
+ $Orwhere = [];
|
|
|
$data['info'][5]['name'] = '国际赛事';
|
|
|
$data['info'][5]['code'] = 'intl';
|
|
|
- $data['info'][5]['count'] = lm('st_area','Sports')
|
|
|
- ->join('st_zq_league','st_zq_league.area_id','st_area.id')
|
|
|
- ->join('st_zq_competition','st_zq_competition.lg_id','st_zq_league.id')
|
|
|
- ->where('st_area.code',"world")
|
|
|
- ->where('st_zq_competition.status', '<', '2')
|
|
|
- ->where('st_zq_competition.us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
- ->where('st_area.source',$this->source['source'])
|
|
|
- ->where('st_zq_competition.home_team','<>',null)
|
|
|
- ->where('st_zq_competition.guest_team','<>',null)
|
|
|
- ->count('*');
|
|
|
+ $data['info'][5]['count'] = $this->getMatchCount($where,$Orwhere,$where_search,$data['game_code']);
|
|
|
return $data;
|
|
|
}
|
|
|
+
|
|
|
/*
|
|
|
*首页条件筛选(其他球参赛表)
|
|
|
*/
|
|
|
@@ -122,25 +88,25 @@ class MatchList extends Controller {
|
|
|
$data['game_code'] = $typeGame;
|
|
|
$data['type'] = lm('GameType','Sports')->where('game_code',$typeGame)->value('game_name');
|
|
|
$st_competition = $getModels['model_match'];
|
|
|
+// 所有赛事
|
|
|
+ $where_search = [];
|
|
|
+ $where = [];
|
|
|
+ $Orwhere = [];
|
|
|
$data['info'][0]['name'] = '所有赛事';
|
|
|
$data['info'][0]['code'] = 'all';
|
|
|
- $data['info'][0]['count'] =lm($st_competition,'Sports')
|
|
|
- ->where([[$st_competition.'.status', '<', '2'],
|
|
|
- [$st_competition.'.source',$this->source['source']]])
|
|
|
- ->where($st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
- ->where($st_competition.'.home_team','<>',null)
|
|
|
- ->where($st_competition.'.guest_team','<>',null)
|
|
|
- ->count('*');
|
|
|
+ $data['info'][0]['count'] = $this->getMatchCount($where,$Orwhere,$where_search,$data['game_code']);
|
|
|
+ //今日赛事
|
|
|
+ $where = $this->commonFunction->getState('StToday',$st_competition);
|
|
|
+ $Orwhere = [];
|
|
|
$data['info'][1]['name'] = '今日赛事';
|
|
|
$data['info'][1]['code'] = 'today';
|
|
|
- $data['info'][1]['count']=lm($st_competition,'Sports')
|
|
|
- ->where($st_competition.'.source',$this->source['source'])
|
|
|
- ->where($this->commonFunction->getState('StToday',$st_competition))
|
|
|
- ->where($st_competition.'.home_team','<>',null)
|
|
|
- ->where($st_competition.'.guest_team','<>',null)
|
|
|
- ->count('*');
|
|
|
- return $data;
|
|
|
+ $data['info'][1]['count']=$this->getMatchCount($where,$Orwhere,$where_search,$data['game_code']);
|
|
|
+ return $data;
|
|
|
}
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 参赛表数据接口
|
|
|
+ */
|
|
|
public function participate(){
|
|
|
$type = $_REQUEST['typeGame'];
|
|
|
if($type != 'zq'|| empty($type)){
|
|
|
@@ -164,343 +130,80 @@ class MatchList extends Controller {
|
|
|
$getModels = $this->commonFunction->getModels($game_code);
|
|
|
$st_league = $getModels['model_league'];
|
|
|
$st_competition = $getModels['model_match'];
|
|
|
+ $st_odds = $getModels['model_odds'];
|
|
|
$where_search = function($query)use ($st_competition,$search){
|
|
|
$query->where($st_competition.'.home_team','like','%'.$search.'%')
|
|
|
->orWhere(function($query)use ($st_competition,$search) {
|
|
|
$query->where($st_competition . '.guest_team', 'like', '%' . $search . '%');
|
|
|
});
|
|
|
};
|
|
|
- $Orwhere = "";
|
|
|
+ $Orwhere = [];
|
|
|
switch ($code)
|
|
|
{
|
|
|
- case $code == 'today':
|
|
|
- $where = $this->commonFunction->getState('StToday',$st_competition);
|
|
|
- //查询今日赛事
|
|
|
- $data = lm($st_competition,'Sports')
|
|
|
- ->join($st_league,$st_league.'.lg_id',$st_competition.'.lg_id')
|
|
|
- ->select($st_league.'.name_chinese',$st_league.'.lg_id')
|
|
|
- ->where($where)
|
|
|
- ->where($where_search)
|
|
|
- ->where($st_competition.'.home_team','<>',null)
|
|
|
- ->where($st_competition.'.guest_team','<>',null)
|
|
|
- ->where($st_competition.'.source',$this->source['source'])
|
|
|
- ->distinct($st_competition.'.match_id')
|
|
|
- ->get()
|
|
|
- ->toarray();
|
|
|
- break;
|
|
|
- case $code == 'popular':
|
|
|
- $where =[
|
|
|
- ['st_area.code','Europe'],[$st_league.'.hot',0],
|
|
|
- [$st_competition.'.status', '<', '2'],
|
|
|
- [$st_competition.'.source',$this->source['source']],
|
|
|
- [$st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4)],
|
|
|
- [$st_competition.'.home_team','<>',null],
|
|
|
- [$st_competition.'.guest_team','<>',null],
|
|
|
-
|
|
|
- ];
|
|
|
- //欧洲最受欢迎的赛事
|
|
|
- $data = lm($st_competition,'Sports')
|
|
|
- ->join($st_league,$st_league.'.lg_id',$st_competition.'.lg_id')
|
|
|
- ->join('st_area','st_area.id','st_zq_league.area_id')
|
|
|
- ->select($st_league.'.name_chinese',$st_league.'.lg_id')
|
|
|
- ->where($where)
|
|
|
- ->where($where_search)
|
|
|
- ->distinct($st_competition.'.match_id')
|
|
|
- ->get()
|
|
|
- ->toarray();
|
|
|
- break;
|
|
|
- case $code == 'asia_aus':
|
|
|
- $where = [
|
|
|
- [$st_competition.'.status', '<', '2'],
|
|
|
- [$st_competition.'.source',$this->source['source']],
|
|
|
- [$st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4)],
|
|
|
- [$st_competition.'.home_team','<>',null],
|
|
|
- [$st_competition.'.guest_team','<>',null],
|
|
|
- ];
|
|
|
+ case $code == 'today':
|
|
|
+ $where =$this->commonFunction->getState('StToday');
|
|
|
+ //查询今日赛事
|
|
|
+ $data = $this->getMatchInfo($where,$Orwhere,$where_search,$game_code);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case $code == 'popular':
|
|
|
+ $where =[['area.name_en','Europe'],[$st_league.'.hot',0]];
|
|
|
+ //欧洲最受欢迎的赛事
|
|
|
+ $data = $this->getMatchInfo($where,$Orwhere,$where_search,$game_code);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case $code == 'asia_aus':
|
|
|
+ $where = [];
|
|
|
$Orwhere = function ($query) {
|
|
|
- $query->Orwhere('st_area.code','=','Asian')
|
|
|
- ->Orwhere('st_country.name_english','=','Australia');
|
|
|
+ $query->Orwhere('area.name_en','=','Asia')
|
|
|
+ ->Orwhere('country.name_en','=','Australia');
|
|
|
};
|
|
|
+ //亚洲/澳洲赛事
|
|
|
+ $data = $this->getMatchInfo($where,$Orwhere,$where_search,$game_code);
|
|
|
+ break;
|
|
|
|
|
|
- //亚洲/澳洲赛事
|
|
|
- $data = lm($st_competition,'Sports')
|
|
|
- ->join($st_league,$st_league.'.lg_id',$st_competition.'.lg_id')
|
|
|
- ->leftjoin('st_country','st_country.country_id',$st_league.'.country_id')
|
|
|
- ->leftjoin('st_area','st_area.id',$st_league.'.area_id')
|
|
|
- ->select($st_league.'.name_chinese',$st_league.'.lg_id')
|
|
|
- ->where($where)
|
|
|
- ->where($Orwhere)
|
|
|
- ->where($where_search)
|
|
|
- ->distinct($st_competition.'.match_id')
|
|
|
- ->get()
|
|
|
- ->toarray();
|
|
|
- break;
|
|
|
- case $code == 'south_north':
|
|
|
- $where = [
|
|
|
- [$st_competition.'.status', '<', '2'],
|
|
|
- [$st_competition.'.source',$this->source['source']],
|
|
|
- [$st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4)],
|
|
|
- [$st_competition.'.home_team','<>',null],
|
|
|
- [$st_competition.'.guest_team','<>',null],
|
|
|
- ];
|
|
|
+ case $code == 'south_north':
|
|
|
+ $where = [];
|
|
|
$Orwhere = function ($query) {
|
|
|
- $query->Orwhere('st_area.code','=', "South_America")
|
|
|
- ->Orwhere('st_area.code','=', "North_America");
|
|
|
+ $query->Orwhere('area.name_en','=', "South America")
|
|
|
+ ->Orwhere('area.name_en','=', "North America");
|
|
|
};
|
|
|
//南美洲/北美洲赛事
|
|
|
- $data = lm($st_competition,'Sports')
|
|
|
- ->join($st_league,$st_league.'.lg_id',$st_league.'.lg_id')
|
|
|
- ->join('st_area','st_area.id','st_zq_league.area_id')
|
|
|
- ->select($st_league.'.name_chinese',$st_league.'.lg_id')
|
|
|
- ->where($where)
|
|
|
- ->where($Orwhere)
|
|
|
- ->where($where_search)
|
|
|
- ->distinct($st_competition.'.match_id')
|
|
|
- ->get()
|
|
|
- ->toarray();
|
|
|
- break;
|
|
|
- case $code == 'tomorrow':
|
|
|
- $where = [
|
|
|
- [$st_competition.'.match_date','tomorrow'],
|
|
|
- [$st_competition.'.status',0],
|
|
|
- [$st_competition.'.source',$this->source['source']],
|
|
|
- [$st_competition.'.home_team','<>',null],
|
|
|
- [$st_competition.'.guest_team','<>',null],
|
|
|
- ];
|
|
|
+ $data = $this->getMatchInfo($where,$Orwhere,$where_search,$game_code);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case $code == 'tomorrow':
|
|
|
+ $where = [[$st_competition.'.match_date','tomorrow']];
|
|
|
//明日赛事
|
|
|
- $data = lm($st_competition,'Sports')
|
|
|
- ->join($st_league,$st_league.'.lg_id',$st_competition.'.lg_id')
|
|
|
- ->select($st_league.'.name_chinese',$st_league.'.lg_id')
|
|
|
- ->where($where)
|
|
|
- ->where($where_search)
|
|
|
- ->distinct($st_league.'.lg_id')
|
|
|
- ->get()
|
|
|
- ->toarray();
|
|
|
- break;
|
|
|
- case $code == 'intl':
|
|
|
- $where = [
|
|
|
- ['st_area.code', "world"],
|
|
|
- [$st_competition.'.status','<','2'],
|
|
|
- [$st_competition.'.source',$this->source['source']],
|
|
|
- [$st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4)],
|
|
|
- [$st_competition.'.home_team','<>',null],
|
|
|
- [$st_competition.'.guest_team','<>',null],
|
|
|
- ];
|
|
|
- //国际赛事
|
|
|
- $data = lm($st_competition,'Sports')
|
|
|
- ->join($st_league,$st_league.'.lg_id',$st_competition.'.lg_id')
|
|
|
- ->join('st_area','st_area.id',$st_league.'.area_id')
|
|
|
- ->select($st_league.'.name_chinese',$st_league.'.lg_id')
|
|
|
- ->where($where)
|
|
|
- ->where($where_search)
|
|
|
- ->distinct($st_competition.'.match_id')
|
|
|
- ->get()
|
|
|
- ->toarray();
|
|
|
- break;
|
|
|
- case $code == 'all':
|
|
|
- $where = [
|
|
|
- [$st_competition.'.status','<', '2'],
|
|
|
- [$st_competition.'.source',$this->source['source']],
|
|
|
- [$st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4)],
|
|
|
- [$st_competition.'.home_team','<>',null],
|
|
|
- [$st_competition.'.guest_team','<>',null],
|
|
|
- ];
|
|
|
- //所有赛事
|
|
|
- $data = lm($st_competition,'Sports')
|
|
|
- ->join($st_league,$st_league.'.lg_id',$st_competition.'.lg_id')
|
|
|
- ->select($st_league.'.name_chinese',$st_league.'.lg_id')
|
|
|
- ->where($where)
|
|
|
- ->where($where_search)
|
|
|
- ->distinct($st_competition.'.match_id')
|
|
|
- ->get()
|
|
|
- ->toarray();
|
|
|
- break;
|
|
|
- case $code == 'qt':
|
|
|
- $where = [
|
|
|
- [$st_competition.'.status','<', '2'],
|
|
|
- [$st_competition.'.source',$this->source['source']],
|
|
|
- [$st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4)],
|
|
|
- [$st_league.'.lg_id',$lg_id],
|
|
|
- [$st_competition.'.home_team','<>',null],
|
|
|
- [$st_competition.'.guest_team','<>',null],
|
|
|
- ];
|
|
|
- //指定联赛下的赛事
|
|
|
- $data = lm($st_competition,'Sports')
|
|
|
- ->join($st_league,$st_league.'.lg_id',$st_competition.'.lg_id')
|
|
|
- ->select($st_league.'.name_chinese',$st_league.'.lg_id')
|
|
|
- ->where($where)
|
|
|
- ->where($where_search)
|
|
|
- ->distinct($st_competition.'.match_id')
|
|
|
- ->get()
|
|
|
- ->toarray();
|
|
|
- break;
|
|
|
- }
|
|
|
- //根据联赛ID赛事信息
|
|
|
- $data = $this->Competition_info($data,$getModels,$where,$where_search,$Orwhere);
|
|
|
- Render($data, '1', lang('Tips','Sports')->get('success'));
|
|
|
- }
|
|
|
- /*
|
|
|
- * 获取联赛信息
|
|
|
- */
|
|
|
- private function Competition_info(array $data,$getModels,$where,$where_search,$Orwhere){
|
|
|
- $st_competition = $getModels['model_match'];
|
|
|
- $st_odds = $getModels['model_odds'];
|
|
|
- $st_league = $getModels['model_league'];
|
|
|
- if(!$Orwhere){
|
|
|
- $Orwhere = [];
|
|
|
- }
|
|
|
- foreach($data as $k => $v){
|
|
|
- //统计赛事
|
|
|
- $data[$k]['count'] = lm($st_competition,'Sports')
|
|
|
- ->join($st_odds,$st_odds.'.match_id',$st_competition.'.match_id')
|
|
|
- ->join($st_league,$st_league.'.lg_id',$st_competition.'.lg_id')
|
|
|
- ->leftjoin('st_country','st_country.country_id',$st_league.'.country_id')
|
|
|
- ->leftjoin('st_area','st_area.id',$st_league.'.area_id')
|
|
|
- ->where($st_competition.'.lg_id',$v['lg_id'])
|
|
|
- ->where($where)
|
|
|
- ->where($Orwhere)
|
|
|
- ->where($where_search)
|
|
|
- ->distinct($st_competition.'.match_id')
|
|
|
- ->count($st_competition.'.match_id');
|
|
|
-
|
|
|
- //获取赛事信息
|
|
|
- $data[$k]['match_info'] = lm($st_competition,'Sports')
|
|
|
- ->join($st_odds,$st_odds.'.match_id',$st_competition.'.match_id')
|
|
|
- ->join($st_league,$st_league.'.lg_id',$st_competition.'.lg_id')
|
|
|
- ->leftjoin('st_country','st_country.country_id',$st_league.'.country_id')
|
|
|
- ->leftjoin('st_area','st_area.id',$st_league.'.area_id')
|
|
|
- ->select($st_competition.'.match_id',$st_competition.'.home_team',$st_competition.'.guest_team',$st_competition.'.match_date',$st_competition.'.status',$st_competition.'.match_time',$st_competition.'.tag')
|
|
|
- ->distinct($st_competition.'.match_id')
|
|
|
- ->where($where)
|
|
|
- ->where($Orwhere)
|
|
|
- ->where($where_search)
|
|
|
- ->where($st_competition.'.lg_id',$v['lg_id'])
|
|
|
- ->get()
|
|
|
- ->toarray();
|
|
|
- if(!$data[$k]['match_info']){
|
|
|
- unset($data[$k]);
|
|
|
- }
|
|
|
- //循环获取赛事赔率
|
|
|
- foreach ($data[$k]['match_info'] as $key=>$item){
|
|
|
- $data[$k]['match_info'][$key]['oddsData'] = lm($st_odds, 'Sports')
|
|
|
- ->select('id','p_code','odds_code','status','odds','condition','sort')
|
|
|
- ->where($this->source)
|
|
|
- ->where(['match_id'=>$item['match_id'],'type'=>0])
|
|
|
- ->where(function($query)use ($st_odds){
|
|
|
- $query->where($st_odds.'.odds_code','concede_home')
|
|
|
- ->orWhere(function($query)use ($st_odds){
|
|
|
- $query->where($st_odds.'.odds_code','concede_guest');
|
|
|
- })
|
|
|
- ->orWhere(function($query)use ($st_odds){
|
|
|
- $query->where($st_odds.'.odds_code','size_home');
|
|
|
- })
|
|
|
- ->orWhere(function($query)use ($st_odds){
|
|
|
- $query->where($st_odds.'.odds_code','size_guest');
|
|
|
- });
|
|
|
- })
|
|
|
- ->get()->toArray();
|
|
|
+ $data = $this->getMatchInfo($where,$Orwhere,$where_search,$game_code);
|
|
|
+ break;
|
|
|
|
|
|
- if(!empty($data[$k]['match_info'][$key]['oddsData'])){
|
|
|
- //根据 排序 获取 最新让球/大小玩法赔率
|
|
|
- $sortData = array_column($data[$k]['match_info'][$key]['oddsData'],'sort');
|
|
|
- array_multisort($sortData,SORT_DESC,$data[$k]['match_info'][$key]['oddsData']);
|
|
|
- $data[$k]['match_info'][$key]['oddsData'] = array_slice($data[$k]['match_info'][$key]['oddsData'],0,4);//前四条 放入
|
|
|
+ case $code == 'intl':
|
|
|
+ $where = [['area.name_en', "world"]];
|
|
|
+ //国际赛事
|
|
|
+ $data = $this->getMatchInfo($where,$Orwhere,$where_search,$game_code);
|
|
|
+ break;
|
|
|
|
|
|
- }else{
|
|
|
- $data[$k]['match_info'][$key]['oddsData'] = [];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return $data;
|
|
|
- }
|
|
|
- /*
|
|
|
- *首页条件筛选(冠军赛事)
|
|
|
- */
|
|
|
- public function first (){
|
|
|
- $gameType = $_REQUEST['typeGame'];
|
|
|
- $search = $_REQUEST['search'];
|
|
|
- //===查询该球类是否存在或启用===
|
|
|
- $gameType = empty($gameType)? 'zq':$gameType;
|
|
|
- $getModels = $this->commonFunction->getModels($gameType);
|
|
|
- $st_league = $getModels['model_league'];
|
|
|
- $st_competition = $getModels['model_match'];
|
|
|
- $data['type'] = lm('GameType', 'Sports')->where('game_code',$gameType)->value('game_name');
|
|
|
- //国家下所有联赛
|
|
|
- $country = lm($st_league,"Sports")
|
|
|
- ->join($st_competition,$st_competition.'.lg_id',$st_league.'.id')
|
|
|
- ->join('st_country','st_country.country_id',$st_league.'.country_id')
|
|
|
- ->select('st_country.id as region_id','st_country.name_chinese as region')
|
|
|
- ->distinct('st_country.name_chinese')
|
|
|
- ->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
|
- ->where($st_league.'.source',$this->source)
|
|
|
- ->where([])
|
|
|
- ->where($st_competition.'.home_team','<>',null)
|
|
|
- ->where($st_competition.'.guest_team','<>',null)
|
|
|
- ->get()
|
|
|
- ->toArray();
|
|
|
- //洲下所有联赛
|
|
|
- $area = lm($st_league,"Sports")
|
|
|
- ->join($st_competition,$st_competition.'.lg_id',$st_league.'.id')
|
|
|
- ->join('st_area','st_area.id',$st_league.'.area_id')
|
|
|
- ->select('st_area.id as region_id','st_area.title as region')
|
|
|
- ->distinct('st_area.title')
|
|
|
- ->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
|
- ->where($st_league.'.source',$this->source)
|
|
|
- ->where()
|
|
|
- ->where([])
|
|
|
- ->where($st_competition.'.home_team','<>',null)
|
|
|
- ->where($st_competition.'.guest_team','<>',null)
|
|
|
- ->get()
|
|
|
- ->toArray();
|
|
|
- //统计国家联赛下的赛事.
|
|
|
- if(!empty($country)){
|
|
|
- foreach($country as $k => $v) {
|
|
|
- $country[$k]['league_count'] = lm($st_league, 'Sports')
|
|
|
- ->select('lg_id', 'name_chinese as league')
|
|
|
- ->where($this->source)
|
|
|
- ->where('country_id', $v['region_id'])
|
|
|
- ->get()->toarray();
|
|
|
- }
|
|
|
- foreach ($country as $k => $v) {
|
|
|
- foreach($v['league_count'] as $kk => $vv ){
|
|
|
- $country[$k]['league_count'][$kk]['count'] = lm($st_competition, 'Sports')
|
|
|
- ->where($this->source)
|
|
|
- ->where('lg_id',$vv['lg_id'])
|
|
|
- ->where($st_competition.'.home_team','<>',null)
|
|
|
- ->where($st_competition.'.guest_team','<>',null)
|
|
|
- ->count('*');
|
|
|
- if($country[$k]['league_count'][$kk]['count'] == 0){
|
|
|
- unset($country[$k]['league_count'][$kk]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ case $code == 'all':
|
|
|
+ $where = [];
|
|
|
+ //所有赛事
|
|
|
+ $data = $this->getMatchInfo($where,$Orwhere,$where_search,$game_code);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case $code == 'qt':
|
|
|
+ $where = [[$st_league.'.lg_id',$lg_id]];
|
|
|
+ //指定联赛下的赛事
|
|
|
+ $data = $this->getMatchInfo($where,$Orwhere,$where_search,$game_code);
|
|
|
+ break;
|
|
|
}
|
|
|
- //统计洲联赛下的赛事
|
|
|
- if(!empty($area)){
|
|
|
- foreach($area as $k => $v) {
|
|
|
- $area[$k]['league_count'] = lm($st_league, 'Sports')
|
|
|
- ->select('lg_id ', 'name_chinese as league')
|
|
|
- ->where($this->source)
|
|
|
- ->where('area_id', $v['region_id'])
|
|
|
- ->get()->toarray();
|
|
|
- }
|
|
|
- foreach ($area as $k => $v) {
|
|
|
- foreach($v['league_count'] as $kk => $vv ){
|
|
|
- $area[$k]['league_count'][$kk]['count'] = lm($st_competition, 'Sports')
|
|
|
- ->where($this->source)
|
|
|
- ->where('lg_id',$vv['lg_id'])
|
|
|
- ->where($st_competition.'.home_team','<>',null)
|
|
|
- ->where($st_competition.'.guest_team','<>',null)
|
|
|
- ->count('*');
|
|
|
- if($area[$k]['league_count'][$kk]['count'] == 0){
|
|
|
- unset($area[$k]['league_count'][$kk]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ //根据赛事ID获取赔率数据
|
|
|
+ foreach($data as $k => $v){
|
|
|
+ $data[$k]['match_info'] = $this->getOdds($v['match_info'],$st_odds);
|
|
|
}
|
|
|
- $data['info'] = array_merge($country,$area);
|
|
|
+
|
|
|
Render($data, '1', lang('Tips','Sports')->get('success'));
|
|
|
}
|
|
|
+
|
|
|
/*
|
|
|
*首页条件筛选(所有赛事)
|
|
|
*/
|
|
|
@@ -508,7 +211,7 @@ class MatchList extends Controller {
|
|
|
$gameType = $_REQUEST['gameType'];
|
|
|
$search = $_REQUEST['search'];
|
|
|
$date = $_REQUEST['datetime'];
|
|
|
- //===查询该球类是否存在或启用===
|
|
|
+ //=获取球了MODEL
|
|
|
$gameType = empty($gameType) ? 'zq':$gameType;
|
|
|
$getModels = $this->commonFunction->getModels($gameType);
|
|
|
$st_league = $getModels['model_league'];
|
|
|
@@ -525,100 +228,88 @@ class MatchList extends Controller {
|
|
|
$where[$st_competition.'.match_date'] = $date;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ //查询球类名称
|
|
|
$data['type'] = lm('GameType', 'Sports')
|
|
|
->where('game_code',$gameType)
|
|
|
->value('game_name');
|
|
|
//国家联赛数据
|
|
|
- $country = lm($st_league,"Sports")
|
|
|
- ->join($st_competition,$st_competition.'.lg_id',$st_league.'.lg_id')
|
|
|
- ->join('st_country','st_country.country_id',$st_league.'.country_id')
|
|
|
- ->select('st_country.country_id as region_id','st_country.name_chinese as region')
|
|
|
- ->distinct($st_league.'.lg_id')
|
|
|
- ->where($st_league.'.source',$this->source)
|
|
|
- ->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
|
- ->where($where)
|
|
|
- ->where($st_competition.'.status', '<', '2')
|
|
|
- ->where($st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
- ->get()
|
|
|
- ->toArray();
|
|
|
-
|
|
|
+ $select=['st_country.country_id as region_id','st_country.name_chinese as region',$st_league.'.lg_id',$st_league.'.name_chinese as league'];
|
|
|
+ $country = $this->getRegionInfo($where,$search,$select,'st_country','country_id',$gameType);
|
|
|
//洲下所有联赛
|
|
|
- $area = lm($st_league,"Sports")
|
|
|
- ->join($st_competition,$st_competition.'.lg_id',$st_league.'.lg_id')
|
|
|
- ->join('st_area','st_area.id',$st_league.'.area_id')
|
|
|
- ->select('st_area.id as region_id','st_area.title as region')
|
|
|
- ->distinct($st_league.'.lg_id')
|
|
|
- ->where($st_league.'.source',$this->source)
|
|
|
- ->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
|
- ->where($where)
|
|
|
- ->where($st_competition.'.status', '<', '2')
|
|
|
- ->where($st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
- ->get()
|
|
|
- ->toArray();
|
|
|
- //统计国家联赛下的赛事
|
|
|
- if(!empty($country)){
|
|
|
- foreach($country as $k => $v) {
|
|
|
- $country[$k]['league_count'] = lm($st_league, 'Sports')
|
|
|
- ->select('lg_id', 'name_chinese as league')
|
|
|
- ->where($st_league.'.source',$this->source)
|
|
|
- ->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
|
- ->where('country_id', $v['region_id'])
|
|
|
- ->get()
|
|
|
- ->toarray();
|
|
|
+ $select=['st_area.id as region_id','st_area.title as region',$st_league.'.lg_id',$st_league.'.name_chinese as league'];
|
|
|
+ $area = $this->getRegionInfo($where,$search,$select,'st_area','id',$gameType);
|
|
|
+ $data['info'] = array_merge($country,$area);
|
|
|
+ Render($data, '1', lang('Tips','Sports')->get('success'));
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 根据地区获取信息
|
|
|
+ * @param [array] $where 条件
|
|
|
+ * @param [array] $search 搜索条件
|
|
|
+ * @param [string] $regionModel 地区model
|
|
|
+ * @param [int] $regionID 地区model
|
|
|
+ * @param [type] $game_code 球类代码
|
|
|
+ * @return [array] $data
|
|
|
+ */
|
|
|
+ public function getRegionInfo($where=[],$search,$select,$regionModel,$regionID,$game_code ='zq'){
|
|
|
+ $getModels = $this->commonFunction->getModels($game_code);
|
|
|
+ $st_league = $getModels['model_league'];
|
|
|
+ $st_competition = $getModels['model_match'];
|
|
|
+ try{
|
|
|
+ //地区联赛赛事数据
|
|
|
+ $regionInfo = lm($st_league,"Sports")
|
|
|
+ ->join($st_competition,$st_competition.'.lg_id',$st_league.'.lg_id')
|
|
|
+ ->join($regionModel,$regionModel.'.'.$regionID,$st_league.'.country_id')
|
|
|
+ ->select($select)
|
|
|
+ ->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
|
+ ->where($where)
|
|
|
+ ->where([
|
|
|
+ [$st_competition.'.home_team','<>',null],
|
|
|
+ [$st_competition.'.guest_team','<>',null],
|
|
|
+ [$st_league.'.name_chinese','<>',null],
|
|
|
+ [$st_competition.'.status','<',2],
|
|
|
+ [$st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4)]
|
|
|
+ ])
|
|
|
+ ->get()
|
|
|
+ ->toArray();
|
|
|
+ //地区分割
|
|
|
+ $info = [];
|
|
|
+ foreach($regionInfo as $k => $v){
|
|
|
+ $info[$k]['region'] = $v['region'];
|
|
|
+ $info[$k]['region_id'] = $v['region_id'];
|
|
|
}
|
|
|
- foreach ($country as $k => $v) {
|
|
|
- foreach($v['league_count'] as $kk => $vv ){
|
|
|
- $country[$k]['league_count'][$kk]['count'] = lm($st_competition, 'Sports')
|
|
|
- ->where($this->source)
|
|
|
- ->where($where)
|
|
|
- ->where('lg_id',$vv['lg_id'])
|
|
|
- ->where('status', '<', '2')
|
|
|
- ->where('us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
- ->where($st_competition.'.home_team','<>',null)
|
|
|
- ->where($st_competition.'.guest_team','<>',null)
|
|
|
- ->count('*');
|
|
|
- if($country[$k]['league_count'][$kk]['count'] == 0){
|
|
|
- unset($country[$k]['league_count'][$kk]);
|
|
|
+ //地区去重
|
|
|
+ $info = array_unique($info, SORT_REGULAR);
|
|
|
+ //根据地区分类
|
|
|
+ foreach ($info as $key => $vlue) {
|
|
|
+ foreach ($regionInfo as $k => $v) {
|
|
|
+ if ($vlue['region'] == $v['region']) {
|
|
|
+ $info[$key]['league_count'][$k]['league'] = $v['league'];
|
|
|
+ $info[$key]['league_count'][$k]['lg_id'] = $v['lg_id'];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- //统计洲联赛下的赛事
|
|
|
- if (!empty($area)){
|
|
|
- foreach($area as $k => $v) {
|
|
|
- $area[$k]['league_count'] = lm($st_league,'Sports')
|
|
|
- ->select('lg_id', 'name_chinese as league')
|
|
|
- ->where($this->source)
|
|
|
- ->where($st_league.'.name_chinese','like','%'.$search.'%')
|
|
|
- ->where('area_id', $v['region_id'])
|
|
|
- ->get()
|
|
|
- ->toarray();
|
|
|
- }
|
|
|
- foreach ($area as $k => $v) {
|
|
|
- foreach($v['league_count'] as $kk => $vv ){
|
|
|
- $area[$k]['league_count'][$kk]['count'] = lm($st_competition, 'Sports')
|
|
|
- ->where($this->source)
|
|
|
- ->where($where)
|
|
|
- ->where($st_competition.'.home_team','<>',null)
|
|
|
- ->where($st_competition.'.guest_team','<>',null)
|
|
|
- ->where('status', '<', '2')
|
|
|
- ->where('us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
|
|
|
- ->where('lg_id',$vv['lg_id'])
|
|
|
- ->count('*');
|
|
|
- if($area[$k]['league_count'][$kk]['count'] == 0){
|
|
|
- unset($area[$k]['league_count'][$kk]);
|
|
|
+ //联赛去重
|
|
|
+ foreach ($info as $key => $vlue) {
|
|
|
+ $info[$key]['league_count'] = array_unique($vlue['league_count'], SORT_REGULAR);
|
|
|
+ //统计联赛下赛事
|
|
|
+ foreach ($vlue['league_count'] as $k => $v) {
|
|
|
+ foreach ($regionInfo as $kk => $vv) {
|
|
|
+ if ($v['league'] == $vv['league']) {
|
|
|
+ if(!empty($info[$key]['league_count'][$kk]['league'])){
|
|
|
+ $info[$key]['league_count'][$kk]['count'] += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ return $info;
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ echo $e->getMessage();
|
|
|
}
|
|
|
- $data['info'] = array_merge($country,$area);
|
|
|
- Render($data, '1', lang('Tips','Sports')->get('success'));
|
|
|
+
|
|
|
}
|
|
|
/**
|
|
|
* 联赛下 赛事及默认赔率数据
|
|
|
- *
|
|
|
*/
|
|
|
public function matchDetails(){
|
|
|
|
|
|
@@ -826,6 +517,7 @@ class MatchList extends Controller {
|
|
|
['home_team','<>',null],
|
|
|
['guest_team','<>',null],
|
|
|
['status','<',2],
|
|
|
+ ['us_time','>',qgmdate('Y-m-d H:i:s', '', -4)],
|
|
|
['lg_id',$matchData->lg_id],
|
|
|
];
|
|
|
|
|
|
@@ -1022,4 +714,147 @@ class MatchList extends Controller {
|
|
|
Render($data, '1', lang('Tips','Sports')->get('success'));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取赛事所有数据
|
|
|
+ * @param [array] $where 条件
|
|
|
+ *@param [array] $Orwhere 或者条件
|
|
|
+ * @param [type] $game_code 球类代码
|
|
|
+ * @return [array] $data
|
|
|
+ */
|
|
|
+ public function getMatchInfo($where=[],$Orwhere=[],$where_search=[],$game_code ='zq'){
|
|
|
+ $getModels = $this->commonFunction->getModels($game_code);
|
|
|
+ $st_league = $getModels['model_league'];
|
|
|
+ $st_competition = $getModels['model_match'];
|
|
|
+ try{
|
|
|
+ //查询今日赛事
|
|
|
+ $data = lm($st_competition,'Sports')
|
|
|
+ ->join($st_league,$st_league.'.lg_id',$st_competition.'.lg_id')
|
|
|
+ ->leftjoin('st_area_country as country','country.id',$st_league.'.country_id')
|
|
|
+ ->leftjoin('st_area_country as area','area.id',$st_league.'.area_id')
|
|
|
+ ->select($st_league.'.name_chinese',$st_league.'.lg_id',$st_competition.'.match_id',$st_competition.'.home_team',$st_competition.'.guest_team',$st_competition.'.match_date',$st_competition.'.status',$st_competition.'.match_time',$st_competition.'.tag','country.name as country_name','area.name as area_name')
|
|
|
+ ->where($where)
|
|
|
+ ->where($Orwhere)
|
|
|
+ ->where($where_search)
|
|
|
+ ->where([
|
|
|
+ [$st_competition.'.home_team','<>',null],
|
|
|
+ [$st_competition.'.guest_team','<>',null],
|
|
|
+ [$st_league.'.name_chinese','<>',null],
|
|
|
+ [$st_competition.'.status','<',2],
|
|
|
+ [$st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4)]
|
|
|
+ ])
|
|
|
+ ->distinct($st_competition.'.match_id')
|
|
|
+ ->get()
|
|
|
+ ->toarray();
|
|
|
+ $data = $this->division($data);
|
|
|
+ return $data;
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ echo $e->getMessage();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 数据分割器
|
|
|
+ * @param [array] $matchData 赛事数据
|
|
|
+ * @param [type] $type 分割类型 1:以联赛分
|
|
|
+ * @return [array] $league
|
|
|
+ */
|
|
|
+ public function division(array $matchData)
|
|
|
+ {
|
|
|
+ //联赛分割
|
|
|
+ $league = [];
|
|
|
+ foreach ($matchData as $k => $v) {
|
|
|
+ $league[$k]['name_chinese'] = $v['name_chinese'];
|
|
|
+ $league[$k]['lg_id'] = $v['lg_id'];
|
|
|
+ }
|
|
|
+ //联赛去重
|
|
|
+ $league = array_unique($league, SORT_REGULAR);
|
|
|
+ //根据联赛分类
|
|
|
+ foreach ($league as $key => $vlue) {
|
|
|
+ foreach ($matchData as $k => $v) {
|
|
|
+ if ($vlue['name_chinese'] == $v['name_chinese']) {
|
|
|
+ $league[$key]['match_info'][$k] = $v;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //统计联赛下赛事
|
|
|
+ foreach ($league as $key => $vlue) {
|
|
|
+ $league[$key]['match_info'] = array_sort($league[$key]['match_info']);
|
|
|
+ $league[$key]['count'] = count($vlue['match_info']);
|
|
|
+ }
|
|
|
+ return $league;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取赛事赔率数据
|
|
|
+ * @param [array] $where 条件
|
|
|
+ *@param [array] $Orwhere 或者条件
|
|
|
+ * @param [type] $game_code 球类代码
|
|
|
+ * @return [array] $data
|
|
|
+ */
|
|
|
+ private function getOdds(array $data,$st_odds){
|
|
|
+ //循环获取赛事赔率
|
|
|
+ foreach ($data as $key=>$item){
|
|
|
+ $data[$key]['oddsData'] = lm($st_odds, 'Sports')
|
|
|
+ ->select('id','p_code','odds_code','status','odds','condition','sort')
|
|
|
+ ->where($this->source)
|
|
|
+ ->where(['match_id'=>$item['match_id'],'type'=>0])
|
|
|
+ ->where(function($query)use ($st_odds){
|
|
|
+ $query->where($st_odds.'.odds_code','concede_home')
|
|
|
+ ->orWhere(function($query)use ($st_odds){
|
|
|
+ $query->where($st_odds.'.odds_code','concede_guest');
|
|
|
+ })
|
|
|
+ ->orWhere(function($query)use ($st_odds){
|
|
|
+ $query->where($st_odds.'.odds_code','size_home');
|
|
|
+ })
|
|
|
+ ->orWhere(function($query)use ($st_odds){
|
|
|
+ $query->where($st_odds.'.odds_code','size_guest');
|
|
|
+ });
|
|
|
+ })
|
|
|
+ ->get()->toArray();
|
|
|
+
|
|
|
+ if(!empty($data[$key]['oddsData'])){
|
|
|
+ //根据 排序 获取 最新让球/大小玩法赔率
|
|
|
+ $sortData = array_column($data[$key]['oddsData'],'sort');
|
|
|
+ array_multisort($sortData,SORT_DESC,$data[$key]['oddsData']);
|
|
|
+ $data[$key]['oddsData'] = array_slice($data[$key]['oddsData'],0,4);//前四条 放入
|
|
|
+ }else{
|
|
|
+ $data[$key]['oddsData'] = [];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $data;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取赛事总数
|
|
|
+ * @param [array] $where 条件
|
|
|
+ *@param [array] $Orwhere 或者条件
|
|
|
+ * @param [type] $game_code 球类代码
|
|
|
+ * @return [int] $dataCount
|
|
|
+ */
|
|
|
+ public function getMatchCount($where=[],$Orwhere=[],$where_search=[],$game_code ='zq'){
|
|
|
+ $getModels = $this->commonFunction->getModels($game_code);
|
|
|
+ $st_league = $getModels['model_league'];
|
|
|
+ $st_competition = $getModels['model_match'];
|
|
|
+
|
|
|
+ //查询今日赛事
|
|
|
+ $dataCount = lm($st_competition,'Sports')
|
|
|
+ ->join($st_league,$st_league.'.lg_id',$st_competition.'.lg_id')
|
|
|
+ ->leftjoin('st_area_country as country','country.id',$st_league.'.country_id')
|
|
|
+ ->leftjoin('st_area_country as area','area.id',$st_league.'.area_id')
|
|
|
+ ->where($where)
|
|
|
+ ->where($Orwhere)
|
|
|
+ ->where($where_search)
|
|
|
+ ->where([
|
|
|
+ [$st_competition.'.home_team','<>',null],
|
|
|
+ [$st_competition.'.guest_team','<>',null],
|
|
|
+ [$st_league.'.name_chinese','<>',null],
|
|
|
+ [$st_competition.'.status','<',2],
|
|
|
+ [$st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4)]
|
|
|
+ ])
|
|
|
+ ->distinct($st_competition.'.match_id')
|
|
|
+ ->count('*');
|
|
|
+
|
|
|
+ return $dataCount;
|
|
|
+ }
|
|
|
+
|
|
|
}
|