From eb682c311ba6f1f7c577b4200f09364343717056 Mon Sep 17 00:00:00 2001 From: salam Date: Fri, 25 Sep 2026 11:38:52 +0200 Subject: [PATCH] wip --- .../Widgets/Boxes/ExpectationsTeam.php | 3 --- .../Charts/LoadEvents/LoadEventsQueryAll.php | 23 ++++++++++--------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/Filament/Widgets/Boxes/ExpectationsTeam.php b/app/Filament/Widgets/Boxes/ExpectationsTeam.php index ffddcd6d..a3c7b82b 100644 --- a/app/Filament/Widgets/Boxes/ExpectationsTeam.php +++ b/app/Filament/Widgets/Boxes/ExpectationsTeam.php @@ -14,8 +14,6 @@ class ExpectationsTeam /** * STATTISTIC DATA */ - $league_id = (int) $filter['league_id'] ?? 0; - $match_id = (int) $filter['match_id'] ?? 0; $team_id = (int) $filter['team_id'] ?? 0; $team_position = $filter['team_position']; $similar_past_matches = $filter['similar_past_matches']; @@ -57,7 +55,6 @@ class ExpectationsTeam $expectations += ['win_count' => 0, 'draw_count' => 0, 'lost_count' => 0]; $count_events = 0; foreach ($res as $value) { - // dd($value); if ($team_id && $team_position == 'home') { $count_events++; switch ($value['result_code']) { diff --git a/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php b/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php index cb7c078a..1ad1617f 100644 --- a/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php +++ b/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryAll.php @@ -55,17 +55,18 @@ class LoadEventsQueryAll $matches_played = []; if ($ss_player_id) { - $matches_season = StatistikoEvent::where(function ($query) use ($team_id, $team_position) { - 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); - } - })->pluck('match_id')->toArray(); + $matches_season = StatistikoEvent::whereIn('season', $season) + ->where(function ($query) use ($team_id, $team_position) { + 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); + } + })->pluck('match_id')->toArray(); $matches_played = StatistikoPlayer::query() ->whereIn('match_id', $matches_season)