wip
This commit is contained in:
1 parent
b784ac3d7a
commit
79bfbde7cb
2 files changed
+24
-2
No files matched your search
+22
@@ -10,6 +10,7 @@ use Filament\Actions\Action;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Actions\ExportAction;
|
||||
use Filament\Actions\Exports\Models\Export;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListStatistikoPlayers extends ListRecords
|
||||
@@ -26,6 +27,27 @@ class ListStatistikoPlayers extends ListRecords
|
||||
->label('Download')
|
||||
->fileName(fn(Export $export): string => 'player-history-' . date('d.m.Y-H.i') . "-{$export->getKey()}")
|
||||
->icon('phosphor-download'),
|
||||
Action::make('count')
|
||||
->color('gray')
|
||||
->tooltip('Count values from selected column')
|
||||
->icon('phosphor-calculator')
|
||||
->schema([
|
||||
Select::make('field')
|
||||
->options([
|
||||
'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();
|
||||
$res = 0;
|
||||
foreach ($players as $key => $value) {
|
||||
$res += $value->card_yellow + $value->card_yellowred + $value->card_red;
|
||||
}
|
||||
dd($res);
|
||||
}),
|
||||
Action::make('starttime')
|
||||
->color('gray')
|
||||
->tooltip('Find events with wrong starttime')
|
||||
|
||||
Reference in new issue
Block a user