This commit is contained in:
salam committed 2026-10-11 08:53:37 +02:00
1 parent e3e74f7d91
commit 34701ecbff
2 files changed
+13 -30

No files matched your search

@@ -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')