fix season
This commit is contained in:
1 parent
d220e340e2
commit
7e30e93f90
5 files changed
+56
-48
No files matched your search
@@ -7,12 +7,14 @@ use App\Actions\LoadStatisticFixturesLeaguesOptions;
|
||||
use App\Actions\LoadStatisticFixturesMatchOptions;
|
||||
use App\Filament\Pages\Selections\LoadPlayer;
|
||||
use App\Filament\Pages\Selections\LoadSeasons;
|
||||
use App\Models\SofaScoreCategory;
|
||||
use App\Models\SofaScoreRosa;
|
||||
use App\Models\StatisticFixtures;
|
||||
use BackedEnum;
|
||||
use BezhanSalleh\FilamentShield\Traits\HasPageShield;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\Hidden;
|
||||
use Filament\Forms\Components\Radio;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Slider;
|
||||
@@ -104,6 +106,7 @@ class Statistic extends BaseDashboard
|
||||
])
|
||||
->columnSpanFull()
|
||||
->schema([
|
||||
Hidden::make('seasonmode'),
|
||||
Select::make('sofascore_category_id')
|
||||
->live()
|
||||
->preload()
|
||||
@@ -113,7 +116,8 @@ class Statistic extends BaseDashboard
|
||||
->hiddenLabel()
|
||||
->options(fn() => LoadSofaScoreCategory::load())
|
||||
->placeholder('Country')
|
||||
->afterStateUpdated(function (callable $set) {
|
||||
->afterStateUpdated(function (callable $set, $state) {
|
||||
$set('seasonmode', SofaScoreCategory::where('id', $state)->value('season_mode'));
|
||||
$set('league_id', null);
|
||||
$set('match_id', null);
|
||||
$set('team_id', null);
|
||||
@@ -133,7 +137,6 @@ class Statistic extends BaseDashboard
|
||||
$set('match_id', null);
|
||||
$set('team_id', null);
|
||||
$set('ss_player_id', null);
|
||||
$set('season', null);
|
||||
}),
|
||||
Select::make('match_id')
|
||||
->live()
|
||||
@@ -355,7 +358,7 @@ class Statistic extends BaseDashboard
|
||||
->hidden(fn(Get $get) => $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none')
|
||||
->prefixIcon('phosphor-calendar-star-fill')
|
||||
->options(function (Get $get) {
|
||||
return LoadSeasons::load($get('sofascore_category_id'));
|
||||
return LoadSeasons::load($get('seasonmode'));
|
||||
})
|
||||
->afterStateUpdated(function (callable $set) {
|
||||
$set('ss_player_id', null);
|
||||
|
||||
Reference in new issue
Block a user