diff --git a/app/Filament/Clusters/StaticData/Resources/StatistikoPlayers/Pages/ListStatistikoPlayers.php b/app/Filament/Clusters/StaticData/Resources/StatistikoPlayers/Pages/ListStatistikoPlayers.php index 63f02a10..338db41d 100644 --- a/app/Filament/Clusters/StaticData/Resources/StatistikoPlayers/Pages/ListStatistikoPlayers.php +++ b/app/Filament/Clusters/StaticData/Resources/StatistikoPlayers/Pages/ListStatistikoPlayers.php @@ -25,7 +25,7 @@ class ListStatistikoPlayers extends ListRecords ->chunkSize(1000) ->exporter(PlayerHistoryExporter::class) ->label('Download') - ->fileName(fn(Export $export): string => 'player-history-' . date('d.m.Y-H.i') . "-{$export->getKey()}") + ->fileName(fn (Export $export): string => 'player-history-'.date('d.m.Y-H.i')."-{$export->getKey()}") ->icon('phosphor-download'), Action::make('count') ->color('gray') @@ -34,11 +34,11 @@ class ListStatistikoPlayers extends ListRecords ->schema([ Select::make('field') ->options([ - 'minutes_played' => 'minutes_played', + 'minutes_played' => 'minutes_played', 'card_yellow' => 'card_yellow', 'card_yellowred' => 'card_yellowred', 'card_red' => 'card_red', - ]) + ]), ]) ->action(function (array $data): void { $players = StatistikoPlayer::where('ss_player_id', 1087079)->get(); @@ -55,6 +55,7 @@ class ListStatistikoPlayers extends ListRecords ->modalSubmitAction(false) ->modalContent(function () { $players = StatistikoPlayer::where('starttime', '<', new DateTime('-10 years'))->get(); + return view('filament.pages.list-player-starttime', ['players' => $players]); }), Action::make('missing') @@ -65,26 +66,8 @@ class ListStatistikoPlayers extends ListRecords ->icon('phosphor-magnifying-glass') ->modalContent(function () { $players = StatistikoPlayer::doesntHave('details')->groupBy('ss_player_id')->get(); - return view('filament.pages.list-missing-player', ['players' => $players]); - }), - Action::make('double') - ->modalSubmitAction(false) - ->icon('phosphor-magnifying-glass') - ->color('gray') - ->modalContent(function () { - $arr = []; - $doubles = []; - $events = StatistikoPlayer::query()->select('match_id', 'ss_player_id')->get()->toArray(); - foreach ($events as $value) { - $match_id = $value['match_id']; - $player_id = $value['ss_player_id']; - if (isset($arr[$match_id]) && in_array($player_id, $arr[$match_id])) { - $doubles[] = ['match_id' => $match_id, 'player_id' => $player_id]; - } - $arr[$match_id][] = $player_id; - } - return view('filament.pages.list-doubles-player', ['doubles' => $doubles]); + return view('filament.pages.list-missing-player', ['players' => $players]); }), Action::make('truncate') ->icon('phosphor-trash') diff --git a/resources/views/filament/pages/list-missing-player.blade.php b/resources/views/filament/pages/list-missing-player.blade.php index 473a96af..6570670c 100644 --- a/resources/views/filament/pages/list-missing-player.blade.php +++ b/resources/views/filament/pages/list-missing-player.blade.php @@ -1,16 +1,16 @@
{{--
Player missing {{ \count($players)}}
--}} - + - {{ \count($players)}} players in table "players" but missing in tavle "details" + {{ \count($players)}} players in table "players" are missing in table "details" -
- @foreach ($players as $player) - -
{{ $player->ss_player_id }}
- - @endforeach +
+
+ @foreach ($players as $player) + {{ $player->ss_player_id }}, + @endforeach +