wip
This commit is contained in:
1 parent
ee3afc95da
commit
7afc8e87ad
1 file changed
+113
-42
+113
-42
@@ -37,6 +37,77 @@ class ListStatistikoPlayers extends ListRecords
|
||||
// UTF-8 BOM für Excel (Umlaute-Fix)
|
||||
fprintf($output, chr(0xEF).chr(0xBB).chr(0xBF));
|
||||
|
||||
fputcsv($output, [
|
||||
'match_id',
|
||||
'ss_player_id',
|
||||
'tm_player_id',
|
||||
'sport_id',
|
||||
'activeteam_id',
|
||||
'assists',
|
||||
'bcc',
|
||||
'bcm',
|
||||
'blocked_shots',
|
||||
'card_red',
|
||||
'card_yellow',
|
||||
'card_yellowred',
|
||||
'clearance_off_line',
|
||||
'clearances',
|
||||
'cross_done',
|
||||
'description_event_during_the_match',
|
||||
'dispossessed',
|
||||
'dribbled_past',
|
||||
'dribbles_won',
|
||||
'errors_lead_to_a_goal',
|
||||
'errors_lead_to_a_shot',
|
||||
'fouls',
|
||||
'goals',
|
||||
'good_high_claim',
|
||||
'hit_woodwork',
|
||||
'ingamepenalty_missed',
|
||||
'interceptions',
|
||||
'key_pass',
|
||||
'last_man_tackle',
|
||||
'lineup',
|
||||
'long_balls',
|
||||
'minute_event_during_the_match',
|
||||
'minutes_played',
|
||||
'offsides',
|
||||
'own_goals',
|
||||
'pass',
|
||||
'penalty_committed',
|
||||
'penalty_miss',
|
||||
'penalty_save',
|
||||
'penalty_won',
|
||||
'penaltyshoutout_missed',
|
||||
'penaltyshoutout_scored',
|
||||
'player_position',
|
||||
'playerrating_value',
|
||||
'playersubstitute_id',
|
||||
'possessions_lost',
|
||||
'punches',
|
||||
'runs_out',
|
||||
'saves',
|
||||
'saves_from_in_box',
|
||||
'shots_blocked',
|
||||
'shots_off_target',
|
||||
'shots_on_target',
|
||||
'subtype_event_during_the_match',
|
||||
'total_aerial_duels',
|
||||
'total_cross',
|
||||
'total_dribbles',
|
||||
'total_duels_aerial_won',
|
||||
'total_ground_duels',
|
||||
'total_ground_duels_won',
|
||||
'total_long_balls',
|
||||
'total_pass',
|
||||
'total_runs_out',
|
||||
'total_tackles',
|
||||
'touches',
|
||||
'type_event_during_the_match',
|
||||
'updated_at',
|
||||
'was_fouled',
|
||||
]);
|
||||
|
||||
// 2. Abfrage definieren
|
||||
$query = StatistikoPlayer::query()->orderBy('_id', 'asc');
|
||||
|
||||
@@ -126,49 +197,49 @@ class ListStatistikoPlayers extends ListRecords
|
||||
fclose($output);
|
||||
}, 'player_history_clean_'.now()->format('Y-m-d').'.csv');
|
||||
}),
|
||||
ExportAction::make('download_players')
|
||||
->label('Export')
|
||||
->icon('phosphor-download')
|
||||
->columnMapping(false)
|
||||
->chunkSize(2000)
|
||||
->exporter(StatistikoPlayerExporter::class)
|
||||
->fileName(function (Export $export): string {
|
||||
$options = $export->getOptions();
|
||||
switch ($options['limit']) {
|
||||
case '1':
|
||||
return 'player-history-0-200k-'.date('d.m.Y-H.i');
|
||||
case '2':
|
||||
return 'player-history-200k-400k-'.date('d.m.Y-H.i');
|
||||
case '3':
|
||||
return 'player-history-400k-600k-'.date('d.m.Y-H.i');
|
||||
case '4':
|
||||
return 'player-history-600k-800k-'.date('d.m.Y-H.i');
|
||||
case '5':
|
||||
return 'player-history-800k-1000k-'.date('d.m.Y-H.i');
|
||||
default:
|
||||
return 'player-history-all-'.date('d.m.Y-H.i');
|
||||
}
|
||||
})
|
||||
->modifyQueryUsing(function (Builder $query, array $options) {
|
||||
if (isset($options['limit'])) {
|
||||
switch ($options['limit']) {
|
||||
case '1':
|
||||
return $query->skip(0)->take(200000);
|
||||
case '2':
|
||||
return $query->skip(200000)->take(200000);
|
||||
case '3':
|
||||
return $query->skip(400000)->take(200000);
|
||||
case '4':
|
||||
return $query->skip(600000)->take(200000);
|
||||
case '5':
|
||||
return $query->skip(800000)->take(200000);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
// ExportAction::make('download_players')
|
||||
// ->label('Export')
|
||||
// ->icon('phosphor-download')
|
||||
// ->columnMapping(false)
|
||||
// ->chunkSize(2000)
|
||||
// ->exporter(StatistikoPlayerExporter::class)
|
||||
// ->fileName(function (Export $export): string {
|
||||
// $options = $export->getOptions();
|
||||
// switch ($options['limit']) {
|
||||
// case '1':
|
||||
// return 'player-history-0-200k-'.date('d.m.Y-H.i');
|
||||
// case '2':
|
||||
// return 'player-history-200k-400k-'.date('d.m.Y-H.i');
|
||||
// case '3':
|
||||
// return 'player-history-400k-600k-'.date('d.m.Y-H.i');
|
||||
// case '4':
|
||||
// return 'player-history-600k-800k-'.date('d.m.Y-H.i');
|
||||
// case '5':
|
||||
// return 'player-history-800k-1000k-'.date('d.m.Y-H.i');
|
||||
// default:
|
||||
// return 'player-history-all-'.date('d.m.Y-H.i');
|
||||
// }
|
||||
// })
|
||||
// ->modifyQueryUsing(function (Builder $query, array $options) {
|
||||
// if (isset($options['limit'])) {
|
||||
// switch ($options['limit']) {
|
||||
// case '1':
|
||||
// return $query->skip(0)->take(200000);
|
||||
// case '2':
|
||||
// return $query->skip(200000)->take(200000);
|
||||
// case '3':
|
||||
// return $query->skip(400000)->take(200000);
|
||||
// case '4':
|
||||
// return $query->skip(600000)->take(200000);
|
||||
// case '5':
|
||||
// return $query->skip(800000)->take(200000);
|
||||
// default:
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
return $query;
|
||||
}),
|
||||
// return $query;
|
||||
// }),
|
||||
Action::make('count')
|
||||
->color('gray')
|
||||
->tooltip('Count values from selected column')
|
||||
|
||||
Reference in new issue
Block a user