|
|
@@ -8,14 +8,28 @@ class Stlqresult extends BaseModel
|
|
|
public $timestamps = false;
|
|
|
protected $fillable = ['lg_id','home_team','guest_team','home_rate','guest_rate','home_score','status','first_score','last_score','match_score','guest_score','match_winer','update_time','match_time','match_process','tag','u_home_score','u_guest_score','match_id','all_goal','source'];
|
|
|
|
|
|
- function resultbklist($list = 10, $page, $where = '', $orwhere = '')
|
|
|
+ function resultbklist($list = 10, $page, $where = '', $orwhere = '',$if_order)
|
|
|
{
|
|
|
- if (is_array ($where) && count ($where) > 0) {
|
|
|
- $data = $this->join('st_lq_league','st_lq_result.lg_id','=','st_lq_league.id')->join('st_lq_competition','st_lq_competition.id','=','st_lq_result.match_id')->select($this->table.'.id',$this->table.'.lg_id',$this->table.'.home_team',$this->table.'.guest_team',$this->table.'.home_rate',$this->table.'.guest_rate',$this->table.'.home_score',$this->table.'.guest_score',$this->table.'.all_goal','st_lq_competition.status',$this->table.'.first_score',$this->table.'.last_score',$this->table.'.match_score',$this->table.'.match_winer',$this->table.'.update_time',$this->table.'.match_time',$this->table.'.match_process',$this->table.'.tag',$this->table.'.match_id',$this->table.'.u_home_score',$this->table.'.start_time',$this->table.'.u_guest_score','st_lq_league.name_chinese')->orderby($this->table.'.id','desc')->where($where)->orwhere($orwhere)->paginate ($list);
|
|
|
- } else {
|
|
|
- $data = $this->join('st_lq_league','st_lq_result.lg_id','=','st_lq_league.id')->join('st_lq_competition','st_lq_competition.id','=','st_lq_result.match_id')->select($this->table.'.id',$this->table.'.lg_id',$this->table.'.home_team',$this->table.'.guest_team',$this->table.'.home_rate',$this->table.'.guest_rate',$this->table.'.home_score',$this->table.'.guest_score',$this->table.'.all_goal','st_lq_competition.status',$this->table.'.first_score',$this->table.'.last_score',$this->table.'.match_score',$this->table.'.match_winer',$this->table.'.update_time',$this->table.'.match_time',$this->table.'.match_process',$this->table.'.tag',$this->table.'.match_id',$this->table.'.u_home_score',$this->table.'.start_time',$this->table.'.u_guest_score','st_lq_league.name_chinese')->orderby($this->table.'.id','desc')->paginate ($list);
|
|
|
+ $match_ids = \App\Models\MoneyBuyMatch::select('match_id')->where('game_code','lq')->get()->toArray();
|
|
|
+ $match_ids = array_column($match_ids,'match_id');
|
|
|
+ //去重
|
|
|
+ $match_ids = array_unique($match_ids);
|
|
|
+
|
|
|
+ if($if_order == 1){
|
|
|
+ if (is_array ($where) && count ($where) > 0) {
|
|
|
+ $data = $this->join('st_lq_league','st_lq_result.lg_id','=','st_lq_league.id')->join('st_lq_competition','st_lq_competition.id','=','st_lq_result.match_id')->select($this->table.'.id',$this->table.'.lg_id',$this->table.'.home_team',$this->table.'.guest_team',$this->table.'.home_rate',$this->table.'.guest_rate',$this->table.'.home_score',$this->table.'.guest_score',$this->table.'.all_goal','st_lq_competition.status',$this->table.'.first_score',$this->table.'.last_score',$this->table.'.match_score',$this->table.'.match_winer',$this->table.'.update_time',$this->table.'.match_time',$this->table.'.match_process',$this->table.'.tag',$this->table.'.match_id',$this->table.'.u_home_score',$this->table.'.start_time',$this->table.'.u_guest_score','st_lq_league.name_chinese')->orderby($this->table.'.id','desc')->where($where)->wherein('st_lq_competition.id',$match_ids)->paginate ($list);
|
|
|
+ } else {
|
|
|
+ $data = $this->join('st_lq_league','st_lq_result.lg_id','=','st_lq_league.id')->join('st_lq_competition','st_lq_competition.id','=','st_lq_result.match_id')->select($this->table.'.id',$this->table.'.lg_id',$this->table.'.home_team',$this->table.'.guest_team',$this->table.'.home_rate',$this->table.'.guest_rate',$this->table.'.home_score',$this->table.'.guest_score',$this->table.'.all_goal','st_lq_competition.status',$this->table.'.first_score',$this->table.'.last_score',$this->table.'.match_score',$this->table.'.match_winer',$this->table.'.update_time',$this->table.'.match_time',$this->table.'.match_process',$this->table.'.tag',$this->table.'.match_id',$this->table.'.u_home_score',$this->table.'.start_time',$this->table.'.u_guest_score','st_lq_league.name_chinese')->orderby($this->table.'.id','desc')->wherein('st_lq_competition.id',$match_ids)->paginate ($list);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if (is_array ($where) && count ($where) > 0) {
|
|
|
+ $data = $this->join('st_lq_league','st_lq_result.lg_id','=','st_lq_league.id')->join('st_lq_competition','st_lq_competition.id','=','st_lq_result.match_id')->select($this->table.'.id',$this->table.'.lg_id',$this->table.'.home_team',$this->table.'.guest_team',$this->table.'.home_rate',$this->table.'.guest_rate',$this->table.'.home_score',$this->table.'.guest_score',$this->table.'.all_goal','st_lq_competition.status',$this->table.'.first_score',$this->table.'.last_score',$this->table.'.match_score',$this->table.'.match_winer',$this->table.'.update_time',$this->table.'.match_time',$this->table.'.match_process',$this->table.'.tag',$this->table.'.match_id',$this->table.'.u_home_score',$this->table.'.start_time',$this->table.'.u_guest_score','st_lq_league.name_chinese')->orderby($this->table.'.id','desc')->where($where)->paginate ($list);
|
|
|
+ } else {
|
|
|
+ $data = $this->join('st_lq_league','st_lq_result.lg_id','=','st_lq_league.id')->join('st_lq_competition','st_lq_competition.id','=','st_lq_result.match_id')->select($this->table.'.id',$this->table.'.lg_id',$this->table.'.home_team',$this->table.'.guest_team',$this->table.'.home_rate',$this->table.'.guest_rate',$this->table.'.home_score',$this->table.'.guest_score',$this->table.'.all_goal','st_lq_competition.status',$this->table.'.first_score',$this->table.'.last_score',$this->table.'.match_score',$this->table.'.match_winer',$this->table.'.update_time',$this->table.'.match_time',$this->table.'.match_process',$this->table.'.tag',$this->table.'.match_id',$this->table.'.u_home_score',$this->table.'.start_time',$this->table.'.u_guest_score','st_lq_league.name_chinese')->orderby($this->table.'.id','desc')->paginate ($list);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
$newsim = new \App\Models\SportsNoteList();
|
|
|
$simplex = $newsim->getsim('lq');
|
|
|
$newstr = new \App\Models\MoneyBuyStr();
|