From 6365f601510e459ff3e4c3f32f8e6b5e4134f59f Mon Sep 17 00:00:00 2001 From: salam Date: Thu, 17 Sep 2026 09:49:45 +0200 Subject: [PATCH] wip --- app/Filament/Widgets/PlayerProps/Expectations.php | 7 ++++++- app/Filament/Widgets/PlayerPropsDrop.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Filament/Widgets/PlayerProps/Expectations.php b/app/Filament/Widgets/PlayerProps/Expectations.php index 1176fb77..54f54d14 100644 --- a/app/Filament/Widgets/PlayerProps/Expectations.php +++ b/app/Filament/Widgets/PlayerProps/Expectations.php @@ -7,7 +7,7 @@ use App\Models\StatistikoEvent; class Expectations { - public static function load(int $team_id) + public static function load(int $team_id, int $count_player) { $bettypes = ['gls', 'fls', 'ofs', 'crd', 'snt', 'tsh']; $data = StatistikoEvent::where(function ($query) use ($team_id) { @@ -70,6 +70,11 @@ class Expectations } } + foreach ($finals as $key => $value) { + $finals[$key]['home'] = $value['home'] * $count_player / 10; + $finals[$key]['away'] = $value['away'] * $count_player / 10; + } + return $finals; } } diff --git a/app/Filament/Widgets/PlayerPropsDrop.php b/app/Filament/Widgets/PlayerPropsDrop.php index f518ee29..39456e8f 100644 --- a/app/Filament/Widgets/PlayerPropsDrop.php +++ b/app/Filament/Widgets/PlayerPropsDrop.php @@ -487,7 +487,7 @@ class PlayerPropsDrop extends Widget } } - $asp_team_all = Expectations::load($team_id); + $asp_team_all = Expectations::load($team_id, $count_player); // Aspettativa Team di Riferimento // (ATR) = Aspettativa Team * Numero di Giocatori di Team in Rosters (esclusi i portieri) / 10.