wip
This commit is contained in:
1 parent
cbddd2fc46
commit
67fe7c1b93
3 files changed
+13
-30
No files matched your search
@@ -2,33 +2,18 @@
|
|||||||
|
|
||||||
namespace App\Filament\Pages\Selections;
|
namespace App\Filament\Pages\Selections;
|
||||||
|
|
||||||
|
use App\Models\SofaScoreCategory;
|
||||||
use App\Models\StatistikoEvent;
|
use App\Models\StatistikoEvent;
|
||||||
|
|
||||||
class LoadSeasons
|
class LoadSeasons
|
||||||
{
|
{
|
||||||
public static function load($league_id = 0)
|
public static function load($league_id)
|
||||||
{
|
{
|
||||||
// $res = CompetitionGroup::with('country')->where('id', $league_id)->first();
|
if(!$league_id){
|
||||||
// $season_mode = $res->country->season_mode;
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
// $res = StatistikoEvent::query()->where('league_id', $league_id)->get();
|
return StatistikoEvent::query()->where('league_id', $league_id)->groupBy('season')->pluck('season','season')->toArray();
|
||||||
|
|
||||||
// if (! $res) {
|
|
||||||
// return [];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $arr = [];
|
|
||||||
// foreach ($res as $val) {
|
|
||||||
// $arr[$val->season] = $val->season;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// asort($arr);
|
|
||||||
|
|
||||||
$arr = [];
|
|
||||||
$arr['24/25'] = '24/25';
|
|
||||||
$arr['25/26'] = '25/26';
|
|
||||||
$arr['26/27'] = '26/27';
|
|
||||||
|
|
||||||
return $arr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@ use App\Actions\LoadSofaScoreCategory;
|
|||||||
use App\Actions\LoadStatisticFixturesLeaguesOptions;
|
use App\Actions\LoadStatisticFixturesLeaguesOptions;
|
||||||
use App\Actions\LoadStatisticFixturesMatchOptions;
|
use App\Actions\LoadStatisticFixturesMatchOptions;
|
||||||
use App\Filament\Pages\Selections\LoadPlayer;
|
use App\Filament\Pages\Selections\LoadPlayer;
|
||||||
|
use App\Filament\Pages\Selections\LoadSeasons;
|
||||||
use App\Models\SofaScoreRosa;
|
use App\Models\SofaScoreRosa;
|
||||||
use App\Models\StatisticFixtures;
|
use App\Models\StatisticFixtures;
|
||||||
use BackedEnum;
|
use BackedEnum;
|
||||||
@@ -23,8 +24,8 @@ use Filament\Schemas\Components\Utilities\Set;
|
|||||||
use Filament\Schemas\Schema;
|
use Filament\Schemas\Schema;
|
||||||
use Filament\Support\RawJs;
|
use Filament\Support\RawJs;
|
||||||
use Illuminate\Contracts\Support\Htmlable;
|
use Illuminate\Contracts\Support\Htmlable;
|
||||||
use Livewire\Component;
|
|
||||||
use Illuminate\Support\HtmlString;
|
use Illuminate\Support\HtmlString;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
class Statistic extends BaseDashboard
|
class Statistic extends BaseDashboard
|
||||||
{
|
{
|
||||||
@@ -348,14 +349,9 @@ class Statistic extends BaseDashboard
|
|||||||
// ->prefixIconColor(fn(Get $get): string => $get('season') ? 'success' : 'primary')
|
// ->prefixIconColor(fn(Get $get): string => $get('season') ? 'success' : 'primary')
|
||||||
->hidden(fn (Get $get) => $get('season_or_date') == 'date')
|
->hidden(fn (Get $get) => $get('season_or_date') == 'date')
|
||||||
->prefixIcon('phosphor-calendar-star-fill')
|
->prefixIcon('phosphor-calendar-star-fill')
|
||||||
->options([
|
->options(function (Get $get) {
|
||||||
'26/27' => '26/27',
|
return LoadSeasons::load($get('league_id'));
|
||||||
'25/26' => '25/26',
|
})
|
||||||
'24/25' => '24/25',
|
|
||||||
])
|
|
||||||
// ->options(function (Get $get) {
|
|
||||||
// return LoadSeasons::load($get('league_id'));
|
|
||||||
// })
|
|
||||||
->afterStateUpdated(function (callable $set) {
|
->afterStateUpdated(function (callable $set) {
|
||||||
$set('ss_player_id', null);
|
$set('ss_player_id', null);
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ class LoadPlayer
|
|||||||
}
|
}
|
||||||
})->pluck('match_id')->toArray();
|
})->pluck('match_id')->toArray();
|
||||||
|
|
||||||
|
// dd($matches_season);
|
||||||
|
|
||||||
$matches_played = StatistikoPlayer::query()
|
$matches_played = StatistikoPlayer::query()
|
||||||
->whereIn('match_id', $matches_season)
|
->whereIn('match_id', $matches_season)
|
||||||
->where('ss_player_id', $ss_player_id)
|
->where('ss_player_id', $ss_player_id)
|
||||||
|
|||||||
Reference in new issue
Block a user