diff --git a/app/Filament/Widgets/Boxes/ExpectationsTeam.php b/app/Filament/Widgets/Boxes/ExpectationsTeam.php index a3c7b82b..66f90e1a 100644 --- a/app/Filament/Widgets/Boxes/ExpectationsTeam.php +++ b/app/Filament/Widgets/Boxes/ExpectationsTeam.php @@ -29,6 +29,7 @@ class ExpectationsTeam } $res = LoadEventsQueryAll::load($filter, $match); + $count_events = $res->count(); if (! $res) { return []; } @@ -53,10 +54,8 @@ class ExpectationsTeam $expectations['away'] = $away_team; $expectations += ['win_count' => 0, 'draw_count' => 0, 'lost_count' => 0]; - $count_events = 0; foreach ($res as $value) { if ($team_id && $team_position == 'home') { - $count_events++; switch ($value['result_code']) { case '1': $expectations['win_count']++; @@ -70,7 +69,6 @@ class ExpectationsTeam } } elseif ($team_id && $team_position == 'away') { - $count_events++; switch ($value['result_code']) { case '1': $expectations['win_count']++; @@ -84,7 +82,6 @@ class ExpectationsTeam } } else { - $count_events++; switch ($value['result_code']) { case '1': $expectations['win_count']++;