From 4b39c59630fffa144b7080b2e519fed7520115a1 Mon Sep 17 00:00:00 2001 From: salam Date: Wed, 7 Oct 2026 12:17:24 +0200 Subject: [PATCH] wip --- app/Filament/Widgets/Boxes/ExpectationsTeam.php | 1 - app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/Filament/Widgets/Boxes/ExpectationsTeam.php b/app/Filament/Widgets/Boxes/ExpectationsTeam.php index ced84bab..0e92a431 100644 --- a/app/Filament/Widgets/Boxes/ExpectationsTeam.php +++ b/app/Filament/Widgets/Boxes/ExpectationsTeam.php @@ -54,7 +54,6 @@ class ExpectationsTeam ExpectationCollecting::sort($similar_past_matches, $tmp, 'crn', $value->home_id, $value->away_id, $value->crn_h, $value->crn_a, $match); } - $expectations = ExpectationCalculation::calc($tmp); $expectations['gls']['name'] = 'Goals'; $expectations['fls']['name'] = 'Fouls'; diff --git a/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php b/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php index 7187034e..af6420c6 100644 --- a/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php +++ b/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php @@ -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); })