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

No files matched your search

@@ -38,7 +38,7 @@ class ListStatistikoPlayers extends ListRecords
'card_yellow' => 'card_yellow', 'card_yellow' => 'card_yellow',
'card_yellowred' => 'card_yellowred', 'card_yellowred' => 'card_yellowred',
'card_red' => 'card_red', 'card_red' => 'card_red',
]) ]),
]) ])
->action(function (array $data): void { ->action(function (array $data): void {
$players = StatistikoPlayer::where('ss_player_id', 1087079)->get(); $players = StatistikoPlayer::where('ss_player_id', 1087079)->get();
@@ -55,6 +55,7 @@ class ListStatistikoPlayers extends ListRecords
->modalSubmitAction(false) ->modalSubmitAction(false)
->modalContent(function () { ->modalContent(function () {
$players = StatistikoPlayer::where('starttime', '<', new DateTime('-10 years'))->get(); $players = StatistikoPlayer::where('starttime', '<', new DateTime('-10 years'))->get();
return view('filament.pages.list-player-starttime', ['players' => $players]); return view('filament.pages.list-player-starttime', ['players' => $players]);
}), }),
Action::make('missing') Action::make('missing')
@@ -65,26 +66,8 @@ class ListStatistikoPlayers extends ListRecords
->icon('phosphor-magnifying-glass') ->icon('phosphor-magnifying-glass')
->modalContent(function () { ->modalContent(function () {
$players = StatistikoPlayer::doesntHave('details')->groupBy('ss_player_id')->get(); $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])) { return view('filament.pages.list-missing-player', ['players' => $players]);
$doubles[] = ['match_id' => $match_id, 'player_id' => $player_id];
}
$arr[$match_id][] = $player_id;
}
return view('filament.pages.list-doubles-player', ['doubles' => $doubles]);
}), }),
Action::make('truncate') Action::make('truncate')
->icon('phosphor-trash') ->icon('phosphor-trash')
@@ -1,16 +1,16 @@
<div> <div>
{{-- <div class="p-2 border text-md">Player missing {{ \count($players)}}</div> --}} {{-- <div class="p-2 border text-md">Player missing {{ \count($players)}}</div> --}}
<x-filament::section> <x-filament::section collapsible>
<x-slot name="heading"> <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> </x-slot>
<div class= "flex flex-wrap gap-2"> <div class="block max-h-64 overflow-y-auto pr-2">
<div class="space-y-">
@foreach ($players as $player) @foreach ($players as $player)
{{ $player->ss_player_id }},
<div>{{ $player->ss_player_id }}</div>
@endforeach @endforeach
</div> </div>
</div>
</x-filament::section> </x-filament::section>
</div> </div>