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\CreateAction;
|
||||||
use Filament\Actions\ExportAction;
|
use Filament\Actions\ExportAction;
|
||||||
use Filament\Actions\Exports\Models\Export;
|
use Filament\Actions\Exports\Models\Export;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
use Filament\Resources\Pages\ListRecords;
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
class ListStatistikoPlayers extends ListRecords
|
class ListStatistikoPlayers extends ListRecords
|
||||||
@@ -26,6 +27,27 @@ class ListStatistikoPlayers extends ListRecords
|
|||||||
->label('Download')
|
->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'),
|
->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')
|
Action::make('starttime')
|
||||||
->color('gray')
|
->color('gray')
|
||||||
->tooltip('Find events with wrong starttime')
|
->tooltip('Find events with wrong starttime')
|
||||||
|
|||||||
@@ -154,8 +154,8 @@ trait UpdateHelper
|
|||||||
$collection['total'][$ss_player_id]['events_played_away'] += 1;
|
$collection['total'][$ss_player_id]['events_played_away'] += 1;
|
||||||
$collection['total'][$ss_player_id]['minutes_played_away'] += $minutes_played;
|
$collection['total'][$ss_player_id]['minutes_played_away'] += $minutes_played;
|
||||||
}
|
}
|
||||||
|
//ubaldo 18. Sep 26 intanto vado avanti, appena trovo qwuaqlcosa ti scrivo, tu togli i red cards dal conteggio
|
||||||
$cards = $val->card_yellow + $val->card_yellowred + $val->card_red;
|
$cards = $val->card_yellow + $val->card_yellowred;
|
||||||
|
|
||||||
$collection[$season][$ss_player_id]['ss_player_id'] = $ss_player_id;
|
$collection[$season][$ss_player_id]['ss_player_id'] = $ss_player_id;
|
||||||
$collection[$season][$ss_player_id]['ss_team_id'] = $ss_team_id;
|
$collection[$season][$ss_player_id]['ss_team_id'] = $ss_team_id;
|
||||||
|
|||||||
Reference in new issue
Block a user