wip
This commit is contained in:
1 parent
e3e74f7d91
commit
34701ecbff
2 files changed
+13
-30
No files matched your search
+5
-22
@@ -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')
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<div>
|
||||
{{-- <div class="p-2 border text-md">Player missing {{ \count($players)}}</div> --}}
|
||||
<x-filament::section>
|
||||
<x-filament::section collapsible>
|
||||
<x-slot name="heading">
|
||||
{{ \count($players)}} players in table "players" but missing in tavle "details"
|
||||
{{ \count($players)}} players in table "players" are missing in table "details"
|
||||
</x-slot>
|
||||
|
||||
<div class= "flex flex-wrap gap-2">
|
||||
@foreach ($players as $player)
|
||||
|
||||
<div>{{ $player->ss_player_id }}</div>
|
||||
|
||||
@endforeach
|
||||
<div class="block max-h-64 overflow-y-auto pr-2">
|
||||
<div class="space-y-">
|
||||
@foreach ($players as $player)
|
||||
{{ $player->ss_player_id }},
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</x-filament::section>
|
||||
</div>
|
||||
Reference in new issue
Block a user