This commit is contained in:
salam committed 2026-10-07 12:17:24 +02:00
1 parent 36584b8de4
commit 4b39c59630
2 files changed
+1 -4

No files matched your search

@@ -25,14 +25,12 @@ class LoadEventsQueryAll
$ss_player_id = (int) $filter['ss_player_id'] ?? 0;
$player_on_field = $filter['player_on_field'] ?? 'all';
$similar_past_matches = $filter['similar_past_matches'];
$team_position = $filter['team_position'];
$handicap_range = [];
$total_range = [];
if ($similar_past_matches != 'none') {
$team_id = 0;
$ss_player_id = 0;
$team_position = '';
$exp_handicap = $match->exp_away - $match->exp_home;
$exp_total = $match->exp_away + $match->exp_home;
$handicap_range = [$exp_handicap - $accuracy, $exp_handicap + $accuracy];
@@ -94,7 +92,7 @@ class LoadEventsQueryAll
return $query->where('league_id', $league_id);
}
})
->where(function ($query) use ($team_id) {
->when($team_id, function ($query) use ($team_id, $player_on_field) {
return $query->where('home_id', '=', $team_id)
->orWhere('away_id', '=', $team_id);
})