diff --git a/app/Filament/Pages/Selections/Helper/GetSeason.php b/app/Filament/Pages/Selections/Helper/GetSeason.php index 6a8c1488..0145efc1 100644 --- a/app/Filament/Pages/Selections/Helper/GetSeason.php +++ b/app/Filament/Pages/Selections/Helper/GetSeason.php @@ -8,7 +8,7 @@ class GetSeason { public static function load(array $season, int|null $sofascore_category_id) { - if (!$season) { + if (!is_array($season) || !count($season)) { if ($sofascore_category_id) { $season_mode = SofaScoreCategory::where('id', $sofascore_category_id)->value('season_mode'); if ($season_mode == 'halfyear') { @@ -17,6 +17,9 @@ class GetSeason else $season[] = date('y', strtotime('-1 year')) . '/' . date('y'); } + else { + $season[] = date('Y'); + } } } diff --git a/app/Filament/Pages/Selections/LoadPlayer.php b/app/Filament/Pages/Selections/LoadPlayer.php index 6ce4b866..63d2afc1 100644 --- a/app/Filament/Pages/Selections/LoadPlayer.php +++ b/app/Filament/Pages/Selections/LoadPlayer.php @@ -13,11 +13,9 @@ class LoadPlayer public static function load(Get $get) { $team_id = $get('team_id'); - $team_position = $get('team_position'); $sofascore_category_id = $get('sofascore_category_id'); $season = $get('season'); - $season = GetSeason::load($season, $sofascore_category_id); $matches = StatistikoEvent::whereIn('season', $season) @@ -33,6 +31,7 @@ class LoadPlayer } })->pluck('match_id')->toArray(); + $matches_count = count($matches); $positions_map = LoadPositions::load();