From f6f5dd0c7c63de0efc585821a2a76eb290ad3086 Mon Sep 17 00:00:00 2001 From: salam Date: Mon, 12 Oct 2026 22:42:32 +0200 Subject: [PATCH] wip --- .../Charts/LoadEvents/LoadEventsQueryAll.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php b/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php index f9367282..fde3dca9 100644 --- a/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php +++ b/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php @@ -23,11 +23,11 @@ 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']; + $spm = $filter['similar_past_matches']; $handicap_range = []; $total_range = []; - if ($similar_past_matches != 'none') { + if ($spm == 'league' or $spm == 'all') { $ss_player_id = 0; $exp_handicap = $match->exp_away - $match->exp_home; $exp_total = $match->exp_away + $match->exp_home; @@ -81,18 +81,18 @@ class LoadEventsQueryAll /** * STATTISTIC DATA */ - // Log::debug('result', [$similar_past_matches, $team_id]); + // Log::debug('result', [$spm, $team_id]); return StatistikoEvent::with('home')->with('away') - ->where(function ($query) use ($league_id, $similar_past_matches) { - switch ($similar_past_matches) { + ->where(function ($query) use ($league_id, $spm) { + switch ($spm) { case 'none': case 'league': return $query->where('league_id', $league_id); } }) - ->where(function ($query) use ($match, $similar_past_matches) { - if ($similar_past_matches == 'none') { + ->where(function ($query) use ($match, $spm) { + if ($spm == 'none') { return $query ->where('home_id', $match->home_id) ->orWhere('home_id', '=', $match->away_id) @@ -117,8 +117,8 @@ class LoadEventsQueryAll })->when($end, function ($query) use ($end) { return $query->whereDate('starttime', '<=', $end); }) - ->when($season, function ($query) use ($season, $season_or_date, $similar_past_matches) { - if ($similar_past_matches == 'none' && $season_or_date == 'season') { + ->when($season, function ($query) use ($season, $season_or_date, $spm) { + if ($spm == 'none' && $season_or_date == 'season') { return $query->whereIn('season', $season); } })