diff --git a/app/Filament/Pages/PlayerProps.php b/app/Filament/Pages/PlayerProps.php index 5357d61c..c7ad2985 100644 --- a/app/Filament/Pages/PlayerProps.php +++ b/app/Filament/Pages/PlayerProps.php @@ -7,6 +7,7 @@ use App\Actions\LoadStatisticFixturesLeaguesOptions; use App\Actions\LoadStatisticFixturesMatchOptions; use App\Filament\Widgets\PlayerPropsDrop; use App\Filament\Widgets\PlayerPropsTable; +use App\Models\SofaScoreCategory; use App\Models\SofaScoreRosa; use App\Models\SsLineupMemory; use App\Models\StatisticFixtures; @@ -66,6 +67,8 @@ class PlayerProps extends Page implements HasForms public string $activeLineUp = '3313'; + public string $season_mode = ''; + public array $players = []; public array $clientLineUps = []; @@ -322,10 +325,16 @@ class PlayerProps extends Page implements HasForms $set('mid', null); $set('tid', null); $this->dispatch('clear-all'); - $this->dispatch('season_mode-update', $state); + $this->setSeason($state); }); } + public function setSeason(string $country_id) + { + $this->season_mode = SofaScoreCategory::where('id', $country_id)->value('season_mode'); + $this->dispatch('season_mode-update', season_mode: $this->season_mode); + } + /** * SECOND LINE */ @@ -392,8 +401,8 @@ class PlayerProps extends Page implements HasForms return new HtmlString('Splits data in 2 Parts
A) Seasons selected, value is % from slider
B) Contains rest from DB, value is 100 - slider value'); } })) - ->options(function (Get $get) { - if ($get('season_mode') == 'halfyear') { + ->options(function () { + if ($this->season_mode == 'halfyear') { return ['26/27' => '26/27', '25/26' => '25/26', '24/25' => '24/25']; } else { return ['2026' => '2026', '2025' => '2025', '2024' => '2024']; diff --git a/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryTP.php b/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryTP.php index 1bab32ba..0f72a02e 100644 --- a/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryTP.php +++ b/app/Filament/Widgets/Charts/LoadEvents/LoadEventsQueryTP.php @@ -98,7 +98,7 @@ class LoadEventsQueryTP /** * STATTISTIC DATA */ - Log::debug('result', [$similar_past_matches, $league_id, $team_id]); + // Log::debug('result', [$similar_past_matches, $league_id, $team_id]); return StatistikoEvent::with('home')->with('away') ->where(function ($query) use ($league_id, $similar_past_matches) { diff --git a/app/Filament/Widgets/PlayerPropsDrop.php b/app/Filament/Widgets/PlayerPropsDrop.php index 2e1a9b9a..4bec5996 100644 --- a/app/Filament/Widgets/PlayerPropsDrop.php +++ b/app/Filament/Widgets/PlayerPropsDrop.php @@ -3,7 +3,6 @@ namespace App\Filament\Widgets; use App\Filament\Widgets\PlayerProps\BoxNames; -use App\Models\SofaScoreCategory; use App\Traits\PlayerProps\BestLineUp; use App\Traits\PlayerProps\ClearBoxes; use App\Traits\PlayerProps\CopyData; @@ -41,42 +40,28 @@ class PlayerPropsDrop extends Widget protected string $view = 'livewire.player-props-drop'; + public string $activeLineUp; + + public string $team_name = ''; + + public string $season_or_date = 'season'; + + public string $date_spliter = ''; + + public string $season_mode; + public float $x_value = 3; public float $y_value = 180; + public float $asp_team; + public int $count_player; public int $home_id; public int $away_id; - public string $team_home_away; - - public float $asp_team; - - public array $activeBoxes; - - public array $beschriftung; - - public array $lineup; - - public array $lineUpMap; - - public string $activeLineUp; - - public array $boxes; - - public string $team_name = ''; - - public string $season_or_date = 'season'; - - public string $season_mode = ''; - - public string $date_spliter = ''; - - public array $season_selected; - public int $team_id = 0; public int $liga_id = 0; @@ -87,10 +72,24 @@ class PlayerPropsDrop extends Widget public int $player_on_field_counter; + public string $team_home_away; + + public array $activeBoxes; + + public array $beschriftung; + + public array $lineup; + + public array $lineUpMap; + + public array $season_selected; + public array $calculationVariables; public array $players; + public array $boxes; + public function mount(): void { $this->activeBoxes = BoxNames::load(); @@ -227,10 +226,8 @@ class PlayerPropsDrop extends Widget } #[On('season_mode-update')] - public function setSeason(string $country_id) + public function setSeason(string $season_mode) { - $season_mode = SofaScoreCategory::where('id', $country_id)->value('season_mode'); - $this->season_mode = $season_mode; } diff --git a/app/Traits/PlayerProps/LineUps.php b/app/Traits/PlayerProps/LineUps.php index d58e8029..aebef2a4 100644 --- a/app/Traits/PlayerProps/LineUps.php +++ b/app/Traits/PlayerProps/LineUps.php @@ -9,7 +9,6 @@ trait LineUps $arr = [ 'team_id' => $this->team_id, 'season_or_date' => $this->season_or_date, - 'season_mode' => $this->season_mode, ]; $players = $this->loadPlayerAll(); diff --git a/app/Traits/PlayerProps/PlayerAspg.php b/app/Traits/PlayerProps/PlayerAspg.php index b2b13133..f816b56e 100644 --- a/app/Traits/PlayerProps/PlayerAspg.php +++ b/app/Traits/PlayerProps/PlayerAspg.php @@ -4,7 +4,6 @@ namespace App\Traits\PlayerProps; use App\Models\StatisticFixtures; use App\Models\StatistikoDetail; -use Illuminate\Support\Facades\Log; trait PlayerAspg { diff --git a/app/Traits/PlayerProps/PlayerQuery.php b/app/Traits/PlayerProps/PlayerQuery.php index 41d5b4dd..b9d2d438 100644 --- a/app/Traits/PlayerProps/PlayerQuery.php +++ b/app/Traits/PlayerProps/PlayerQuery.php @@ -6,7 +6,6 @@ use App\Models\StatistikoDetail; use App\Models\StatistikoEvent; use App\Models\StatistikoPlayer; use Illuminate\Support\Carbon; -use Illuminate\Support\Facades\Log; trait PlayerQuery { @@ -25,7 +24,7 @@ trait PlayerQuery // dd($this->liga_id, $this->season_selected); } - Log::debug('season_selected', [$this->liga_id, $this->season_selected]); + // Log::debug('season_selected', [$this->liga_id, $this->season_selected]); $matches_ids = match ($part) { 1 => StatistikoEvent::where('league_id', $this->liga_id)