fix date box selection
This commit is contained in:
1 parent
d8bb8153d9
commit
d746d34271
4 files changed
+67
-31
No files matched your search
@@ -19,6 +19,7 @@ class LoadEventsQuery
|
||||
$similar_past_matches = $filter['similar_past_matches'];
|
||||
$statistic_type = $filter['statistic_type'] ?? 'gls';
|
||||
$team_position = $filter['team_position'];
|
||||
$season_or_date = $filter['season_or_date'] ?? 'season';
|
||||
$home_id = $match->home_id;
|
||||
$away_id = $match->away_id;
|
||||
|
||||
@@ -26,6 +27,16 @@ class LoadEventsQuery
|
||||
$statistic_type = 'gls';
|
||||
}
|
||||
|
||||
switch ($season_or_date) {
|
||||
case 'season':
|
||||
$start = 0;
|
||||
$end = 0;
|
||||
break;
|
||||
default:
|
||||
$season = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/**
|
||||
* IF WITH PLAYER
|
||||
*/
|
||||
@@ -99,9 +110,9 @@ class LoadEventsQuery
|
||||
})->when($total_range, function ($query) use ($total_range) {
|
||||
return $query->whereBetween('exp_total', $total_range);
|
||||
})->when($start, function ($query) use ($start) {
|
||||
return $query->where('starttime', '>=', $start);
|
||||
return $query->whereDate('starttime', '>=', $start);
|
||||
})->when($end, function ($query) use ($end) {
|
||||
return $query->where('starttime', '<=', $end);
|
||||
return $query->whereDate('starttime', '<=', $end);
|
||||
})->when($season, function ($query) use ($season) {
|
||||
return $query->whereIn('season', $season);
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user