move all to ss IDs
This commit is contained in:
1 parent
09bf62c525
commit
df0a2a9de0
24 files changed
+527
-101
No files matched your search
-5
@@ -49,9 +49,4 @@ class CompetitionGroupResource extends Resource
|
||||
{
|
||||
return parent::getEloquentQuery()->count();
|
||||
}
|
||||
|
||||
public static function getNavigationBadgeColor(): ?string
|
||||
{
|
||||
return 'warning';
|
||||
}
|
||||
}
|
||||
@@ -142,11 +142,6 @@ class CountryResource extends Resource
|
||||
return parent::getEloquentQuery()->where('disabled', false)->count();
|
||||
}
|
||||
|
||||
public static function getNavigationBadgeColor(): ?string
|
||||
{
|
||||
return 'warning';
|
||||
}
|
||||
|
||||
public static function getEloquentQuery(): Builder
|
||||
{
|
||||
return parent::getEloquentQuery()->where('disabled', false);
|
||||
|
||||
@@ -45,9 +45,4 @@ class ElementResource extends Resource
|
||||
{
|
||||
return parent::getEloquentQuery()->count();
|
||||
}
|
||||
|
||||
public static function getNavigationBadgeColor(): ?string
|
||||
{
|
||||
return 'warning';
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,8 @@ class SofaScoreRosaResource extends Resource
|
||||
|
||||
protected static ?string $cluster = StaticDataCluster::class;
|
||||
|
||||
protected static ?int $navigationSort = 3;
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
protected static ?string $navigationLabel = 'Rosters';
|
||||
|
||||
@@ -24,7 +24,7 @@ class SofaScoreTaskResource extends Resource
|
||||
|
||||
protected static ?string $modelLabel = 'Tasks';
|
||||
|
||||
protected static ?int $navigationSort = 1;
|
||||
protected static ?int $navigationSort = 2;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'SofaScore';
|
||||
|
||||
|
||||
+3
-2
@@ -22,9 +22,10 @@ class SofaScoreTasksTable
|
||||
->icon(fn($record) => $record->sport->icon),
|
||||
TextColumn::make('sport.name'),
|
||||
TextColumn::make('mode')
|
||||
->label('Grapping dates')
|
||||
->label('Grapping Task')
|
||||
->formatStateUsing(fn(string $state, $record): string => match ($state) {
|
||||
'daily' => 'Daily',
|
||||
'daily' => 'Daily run',
|
||||
'excel' => 'Import to Excel',
|
||||
'date' => $record->day_from,
|
||||
'range' => $record->day_from . ' <=> ' . $record->day_to,
|
||||
}),
|
||||
|
||||
+2
-2
@@ -20,9 +20,9 @@ class StatisticFixturesResource extends Resource
|
||||
|
||||
protected static ?string $modelLabel = 'Fixtures';
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Statistiko';
|
||||
protected static string|UnitEnum|null $navigationGroup = 'SofaScore';
|
||||
|
||||
protected static ?int $navigationSort = 2;
|
||||
protected static ?int $navigationSort = 5;
|
||||
|
||||
protected static ?string $cluster = StaticDataCluster::class;
|
||||
|
||||
|
||||
+40
-15
@@ -3,15 +3,19 @@
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatisticFixtures\Tables;
|
||||
|
||||
use App\Actions\LoadStatisticFixturesLeaguesOptions;
|
||||
use App\Models\Sport;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class StatisticFixturesTable
|
||||
{
|
||||
@@ -30,30 +34,51 @@ class StatisticFixturesTable
|
||||
TextColumn::make('league.name')
|
||||
->label('League')
|
||||
->searchable()
|
||||
->wrap()
|
||||
->tooltip(fn($record) => $record->league_id)
|
||||
->hidden(fn() => auth()->user()->sport_id == 5)
|
||||
->description(fn($record) => ucwords($record->league?->country->name)),
|
||||
->description(
|
||||
fn($record) => $record->league->sofascore_category->name
|
||||
),
|
||||
TextColumn::make('starttime')->dateTime('Y-m-d H:i'),
|
||||
TextColumn::make('home.name')
|
||||
TextColumn::make('home.ss_team_name')
|
||||
->tooltip(fn($record) => $record->home_id)
|
||||
->color('primary')
|
||||
->searchable(),
|
||||
TextColumn::make('away.name')
|
||||
TextColumn::make('away.ss_team_name')
|
||||
->tooltip(fn($record) => $record->away_id)
|
||||
->color('success')
|
||||
->searchable(),
|
||||
// TextColumn::make('exp_home')->alignCenter()->numeric(),
|
||||
// TextColumn::make('exp_away')->alignCenter()->numeric(),
|
||||
TextColumn::make('updated_at')->alignCenter()->date(),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('league_id')
|
||||
->options(fn() => LoadStatisticFixturesLeaguesOptions::load(1))
|
||||
->preload()
|
||||
->searchable()
|
||||
->columnSpan(2)
|
||||
->label('League'),
|
||||
Filter::make('fixture_filters')
|
||||
->columns(3)
|
||||
->columnSpan(3)
|
||||
->schema([
|
||||
Select::make('sport_id')
|
||||
->default(1)
|
||||
->options(fn() => Sport::query()->where('is_active', 1)->pluck('name', 'id'))
|
||||
->selectablePlaceholder(false)
|
||||
->label('Sport')
|
||||
->live(),
|
||||
Select::make('league_id')
|
||||
->options(fn(Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sport_id')))
|
||||
->preload()
|
||||
->searchable()
|
||||
->columnSpan(2)
|
||||
->label('League'),
|
||||
])->query(function (Builder $query, array $data): Builder {
|
||||
return $query->when(
|
||||
$data['league_id'],
|
||||
function (Builder $query, $league_id) {
|
||||
$query->where('league_id', $league_id)->orderBy('league_id');
|
||||
}
|
||||
)->when(
|
||||
$data['sport_id'],
|
||||
function (Builder $query, $away_id) {
|
||||
$query->where('sport_id', (int) $away_id);
|
||||
}
|
||||
);
|
||||
}),
|
||||
|
||||
], layout: FiltersLayout::AboveContent)
|
||||
->deferFilters(false)
|
||||
->recordActions([
|
||||
|
||||
+2
-2
@@ -20,11 +20,11 @@ class StatistikoDetailResource extends Resource
|
||||
|
||||
protected static ?string $modelLabel = 'Details';
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Statistiko';
|
||||
protected static string|UnitEnum|null $navigationGroup = 'SofaScore';
|
||||
|
||||
protected static ?string $cluster = StaticDataCluster::class;
|
||||
|
||||
protected static ?int $navigationSort = 4;
|
||||
protected static ?int $navigationSort = 9;
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'player_name';
|
||||
|
||||
|
||||
+2
-2
@@ -20,9 +20,9 @@ class StatistikoEventsResource extends Resource
|
||||
|
||||
protected static ?string $modelLabel = 'Events';
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Statistiko';
|
||||
protected static string|UnitEnum|null $navigationGroup = 'SofaScore';
|
||||
|
||||
protected static ?int $navigationSort = 3;
|
||||
protected static ?int $navigationSort = 6;
|
||||
|
||||
protected static ?string $cluster = StaticDataCluster::class;
|
||||
|
||||
|
||||
+5
-16
@@ -35,23 +35,12 @@ class StatistikoEventsTable
|
||||
TextColumn::make('match_id')
|
||||
->sortable(),
|
||||
TextColumn::make('league.name')
|
||||
->searchable()
|
||||
->copyable()
|
||||
->copyMessage('Liga name copied')
|
||||
->description(fn($record) => ucwords($record->league?->country->name))
|
||||
->copyMessageDuration(1500),
|
||||
TextColumn::make('home.name')
|
||||
->searchable()
|
||||
->copyable()
|
||||
->copyMessage('Home team name copied')
|
||||
->copyMessageDuration(1500),
|
||||
TextColumn::make('away.name')
|
||||
->searchable()
|
||||
->copyable()
|
||||
->copyMessage('Away team name copied')
|
||||
->copyMessageDuration(1500),
|
||||
->searchable(),
|
||||
TextColumn::make('home.ss_team_name')->color('info')
|
||||
->searchable(),
|
||||
TextColumn::make('away.ss_team_name')->color('success')
|
||||
->searchable(),
|
||||
TextColumn::make('starttime')->dateTime('Y-m-d H:i'),
|
||||
|
||||
])
|
||||
->filters([
|
||||
Filter::make('event_filters')
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ class StatistikaImportResource extends Resource
|
||||
|
||||
protected static ?string $modelLabel = 'File Uploads';
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Statistiko';
|
||||
protected static string|UnitEnum|null $navigationGroup = 'SofaScore';
|
||||
|
||||
protected static ?int $navigationSort = 1;
|
||||
|
||||
|
||||
+2
-2
@@ -20,11 +20,11 @@ class StatistikoPlayerResource extends Resource
|
||||
|
||||
protected static ?string $modelLabel = 'Player';
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Statistiko';
|
||||
protected static string|UnitEnum|null $navigationGroup = 'SofaScore';
|
||||
|
||||
protected static ?string $cluster = StaticDataCluster::class;
|
||||
|
||||
protected static ?int $navigationSort = 5;
|
||||
protected static ?int $navigationSort = 8;
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'player.name';
|
||||
|
||||
|
||||
Reference in new issue
Block a user