wip
This commit is contained in:
1 parent
712b2f2f68
commit
be67754a38
2 files changed
+9
-10
No files matched your search
@@ -34,8 +34,6 @@ class BoxesBettypeAll extends StatsOverviewWidget
|
||||
{
|
||||
$data = LoadEventsBoxes::load($this->filters, false);
|
||||
|
||||
// dd($data);
|
||||
|
||||
$similar_past_matches = $this->filters['similar_past_matches'];
|
||||
$team_position = $this->filters['team_position'];
|
||||
|
||||
|
||||
@@ -26,8 +26,6 @@ class LoadEventsQueryAll
|
||||
$player_on_field = $filter['player_on_field'] ?? 'all';
|
||||
$similar_past_matches = $filter['similar_past_matches'];
|
||||
$team_position = $filter['team_position'];
|
||||
$home_id = $match->home_id;
|
||||
$away_id = $match->away_id;
|
||||
|
||||
$handicap_range = [];
|
||||
$total_range = [];
|
||||
@@ -103,13 +101,16 @@ class LoadEventsQueryAll
|
||||
return $query->where('league_id', $league_id);
|
||||
}
|
||||
})
|
||||
->where(function ($query) use ($team_id, $home_id, $away_id, $similar_past_matches) {
|
||||
if ($similar_past_matches == 'none') {
|
||||
if ($team_id) {
|
||||
return $query->orWhere('home_id', $team_id)
|
||||
->where(function ($query) use ($team_id, $similar_past_matches, $team_position) {
|
||||
if ($team_id && $similar_past_matches == 'none') {
|
||||
switch ($team_position) {
|
||||
case 'home':
|
||||
return $query->where('home_id', '=', $team_id);
|
||||
case 'away':
|
||||
return $query->where('away_id', '=', $team_id);
|
||||
default:
|
||||
return $query->where('home_id', '=', $team_id)
|
||||
->orWhere('away_id', '=', $team_id);
|
||||
} else {
|
||||
return $query->whereIn('home_id', [$home_id, $away_id])->orWhereIn('away_id', [$home_id, $away_id]);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user