This commit is contained in:
salam committed 2026-08-05 15:46:04 +02:00
1 parent dd51d927dc
commit bb6986d6e5
6 files changed
+69 -7

No files matched your search

@@ -4,6 +4,7 @@ namespace App\Filament\Clusters\StaticData\Resources\StatisticFixtures\Pages;
use App\Filament\Clusters\StaticData\Resources\StatisticFixtures\StatisticFixturesResource;
use App\Models\StatisticFixtures;
use DateTime;
use Filament\Actions\Action;
use Filament\Resources\Pages\ListRecords;
@@ -14,15 +15,26 @@ class ListStatisticFixtures extends ListRecords
protected function getHeaderActions(): array
{
return [
Action::make('starttime')
->color('gray')
->tooltip('Find events with wrong starttime')
->icon('phosphor-magnifying-glass')
->modalSubmitAction(false)
->modalContent(function () {
$events = StatisticFixtures::with('league')->with('home')->with('away')->where('starttime', '<', new DateTime('-10 years'))->get();
return view('filament.pages.list-fixtures-starttime', ['events' => $events]);
}),
Action::make('truncate')
->icon('phosphor-trash')
->tooltip('Delete all events')
->requiresConfirmation()
->color('danger')
->action(function () {
StatisticFixtures::truncate();
}),
Action::make('delete_old')
Action::make('delete')
->icon('phosphor-trash')
->tooltip('Delete events already started')
->requiresConfirmation()
->color('danger')
->action(function () {
@@ -4,9 +4,9 @@ namespace App\Filament\Clusters\StaticData\Resources\StatistikoEvents\Pages;
use App\Filament\Clusters\StaticData\Resources\StatistikoEvents\StatistikoEventsResource;
use App\Models\StatistikoEvent;
use DateTime;
use Filament\Actions\Action;
use Filament\Actions\CreateAction;
// use Filament\Actions\ImportAction;
use Filament\Resources\Pages\ListRecords;
class ListStatistikoEvents extends ListRecords
@@ -16,9 +16,15 @@ class ListStatistikoEvents extends ListRecords
protected function getHeaderActions(): array
{
return [
// Action::make('download')
// ->icon('phosphor-download')
// ->color('gray'),
Action::make('starttime')
->color('gray')
->tooltip('Find events with wrong starttime')
->icon('phosphor-magnifying-glass')
->modalSubmitAction(false)
->modalContent(function () {
$events = StatistikoEvent::with('league')->with('home')->with('away')->where('starttime', '<', new DateTime('-10 years'))->get();
return view('filament.pages.list-fixtures-starttime', ['events' => $events]);
}),
Action::make('truncate')
->icon('phosphor-trash')
->requiresConfirmation()
@@ -4,11 +4,10 @@ namespace App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\Pages;
use App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\StatistikoPlayerResource;
use App\Models\StatistikoPlayer;
use DateTime;
use Filament\Actions\Action;
use Filament\Actions\CreateAction;
use Filament\Infolists\Components\TextEntry;
use Filament\Resources\Pages\ListRecords;
use Illuminate\Contracts\View\View;
class ListStatistikoPlayers extends ListRecords
{
@@ -17,8 +16,18 @@ class ListStatistikoPlayers extends ListRecords
protected function getHeaderActions(): array
{
return [
Action::make('starttime')
->color('gray')
->tooltip('Find events with wrong starttime')
->icon('phosphor-magnifying-glass')
->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')
->color('gray')
->modalSubmitAction(false)
->modalHeading('Missing Player')
->tooltip('Element in player but missing in details')
->icon('phosphor-magnifying-glass')
@@ -27,6 +36,7 @@ class ListStatistikoPlayers extends ListRecords
return view('filament.pages.list-missing-player', ['players' => $players]);
}),
Action::make('double')
->modalSubmitAction(false)
->icon('phosphor-magnifying-glass')
->color('gray')
->modalContent(function () {
+1
View File
@@ -23,6 +23,7 @@ class StatisticFixtures extends Model
];
}
public function sport()
{
return $this->belongsTo(Sport::class)->where('is_active', 1);
@@ -0,0 +1,17 @@
<div>
<x-filament::fieldset>
<x-slot name="label">
Events with wrong starttime: {{ $events->count() }}
</x-slot>
<div class="grid grid-cols-5 gap-4">
@foreach ($events as $event)
<div>{{ $event->match_id }}</div>
<div>{{ $event->starttime }}</div>
<div>{{ $event->league->name }}</div>
<div>{{ $event->home->ss_team_name }}</div>
<div>{{ $event->away->ss_team_name }}</div>
@endforeach
</div>
</x-filament::fieldset>
</div>
@@ -0,0 +1,16 @@
<div>
{{-- <div class="p-2 border text-md">Player missing {{ \count($players)}}</div> --}}
<x-filament::section>
<x-slot name="heading">
{{ \count($players)}} players with wrong starttime
</x-slot>
<div class= "flex flex-wrap gap-2">
@foreach ($players as $player)
<div>{{ $player->ss_player_id }}</div>
@endforeach
</div>
</x-filament::section>
</div>