From f37c00ea0be08ee21a9f9b31d9351005235e8ca3 Mon Sep 17 00:00:00 2001 From: salam Date: Sun, 14 Jun 2026 16:18:34 +0200 Subject: [PATCH] bug card away 0 --- BUGS.md | 2 +- app/Filament/Widgets/Data/LoadEvents.php | 2 +- app/Filament/Widgets/StatsMedianAverage.php | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/BUGS.md b/BUGS.md index 0aecaaaf..3ab423bc 100644 --- a/BUGS.md +++ b/BUGS.md @@ -13,7 +13,7 @@ ## 1) GRAFICI: visualizzare di default solo un grafico, relativo a IN FAVOUR per Events o HOMETEAM per Performaces ## 2) CALCOLO DELLA MEDIANA: cambiamolo in questo modo: ordiniamo tutti i valori dal minore al maggiore, se il totale dati è dispari prendiamo il valore a metà dell'elenco, se è pari facciamo la media dei due valori a metà dell'elenco -3) RIEPILOGO DATI: sostituire HOME con IN FAVOUR e AWAY con AGAINST +## 3) RIEPILOGO DATI: sostituire HOME con IN FAVOUR e AWAY con AGAINST 4) CALCOLO SBAGLIATO di CARDS AWAY di qualsiasi squadra. Viene visualizzato sempre 0 ma i dati sono presenti nel DB 5) Aggiungere, nel caso l'operatore scelga di visualizzare i dati statistici GOALS a livello di EVENTS, anche il grafico relativo alle Aspettative Goals Fatte e Subite che possiamo denominare EG-In Favour e EG-Against 6) Aggiungere nel Grafico Performance anche i dati della partita (Data / Home / Away / Risultato) come per gli altri grafici diff --git a/app/Filament/Widgets/Data/LoadEvents.php b/app/Filament/Widgets/Data/LoadEvents.php index c3ad0c4c..454c91b5 100644 --- a/app/Filament/Widgets/Data/LoadEvents.php +++ b/app/Filament/Widgets/Data/LoadEvents.php @@ -244,7 +244,7 @@ class LoadEvents break; case 'crd': $val_home = (int) $value['crd_a']; - $val_away = (int) $value['crds_h']; + $val_away = (int) $value['crd_h']; break; case 'snt': $val_home = (int) $value['snt_a']; diff --git a/app/Filament/Widgets/StatsMedianAverage.php b/app/Filament/Widgets/StatsMedianAverage.php index 95f14b07..8feab380 100644 --- a/app/Filament/Widgets/StatsMedianAverage.php +++ b/app/Filament/Widgets/StatsMedianAverage.php @@ -61,16 +61,16 @@ class StatsMedianAverage extends StatsOverviewWidget $away_team = $data['away_team']; } - if (! $total_home) { - return [ - Stat::make('Number of events', 0), - Stat::make('Average ' . $statistic_type, self::template(0, 0, $home_team, $away_team)), - Stat::make('Median ' . $statistic_type, self::template(0, 0, $home_team, $away_team)), - Stat::make('Win', 0), - Stat::make('Draw', 0), - Stat::make('Lost', 0), - ]; - } + // if (! $total_home) { + // return [ + // Stat::make('Number of events', 0), + // Stat::make('Average ' . $statistic_type, self::template(0, 0, $home_team, $away_team)), + // Stat::make('Median ' . $statistic_type, self::template(0, 0, $home_team, $away_team)), + // Stat::make('Win', 0), + // Stat::make('Draw', 0), + // Stat::make('Lost', 0), + // ]; + // } $median_home = self::getMedian($arr_home); $median_away = self::getMedian($arr_away);