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