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.