From f09f4f0dd07ea07cbab8b94832857ce720343215 Mon Sep 17 00:00:00 2001 From: salam Date: Mon, 24 Aug 2026 15:27:08 +0200 Subject: [PATCH] wip --- app/Filament/Widgets/Data/LoadEvents.php | 2 + .../Data/LoadEvents/LoadEventsQuery.php | 18 +++--- .../views/filament/pages/statistic.blade.php | 63 ++++++++++--------- 3 files changed, 46 insertions(+), 37 deletions(-) diff --git a/app/Filament/Widgets/Data/LoadEvents.php b/app/Filament/Widgets/Data/LoadEvents.php index 91dcc2ba..b70f0c0e 100644 --- a/app/Filament/Widgets/Data/LoadEvents.php +++ b/app/Filament/Widgets/Data/LoadEvents.php @@ -6,6 +6,7 @@ use App\Filament\Widgets\Data\LoadEvents\LoadEventsAverages; use App\Filament\Widgets\Data\LoadEvents\LoadEventsQuery; use App\Filament\Widgets\Data\LoadEvents\LoadExpectations; use App\Models\StatisticFixtures; +use App\Models\StatistikoEvent; use Illuminate\Support\Carbon; class LoadEvents @@ -65,6 +66,7 @@ class LoadEvents /** * STATTISTIC DATA */ + $res = LoadEventsQuery::load($filter, $handicap_range, $total_range, $match); $dataset_home = []; diff --git a/app/Filament/Widgets/Data/LoadEvents/LoadEventsQuery.php b/app/Filament/Widgets/Data/LoadEvents/LoadEventsQuery.php index c88ec3a6..006a43e7 100644 --- a/app/Filament/Widgets/Data/LoadEvents/LoadEventsQuery.php +++ b/app/Filament/Widgets/Data/LoadEvents/LoadEventsQuery.php @@ -43,6 +43,7 @@ class LoadEventsQuery $matches_played = []; if ($ss_player_id) { + dd('ss_player_id', $ss_player_id); $matches_season = StatistikoEvent::where(function ($query) use ($team_id, $team_position) { switch ($team_position) { case 'home': @@ -84,7 +85,8 @@ class LoadEventsQuery /** * STATTISTIC DATA */ - $res = StatistikoEvent::with('home')->with('away') + + $res = StatistikoEvent::with('home')->with('away')->where('league_id', 18) ->where(function ($query) use ($league_id, $similar_past_matches) { switch ($similar_past_matches) { case 'none': @@ -92,20 +94,20 @@ class LoadEventsQuery return $query->where('league_id', $league_id); } }) - ->where(function ($query) use ($home_id, $away_id, $similar_past_matches) { + ->where(function ($query) use ($team_id, $similar_past_matches) { if ($similar_past_matches == 'none') { - return $query->where('home_id', '=', $home_id) - ->orWhere('away_id', '=', $home_id) - ->orWhere('home_id', '=', $away_id) - ->orWhere('away_id', '=', $away_id); + return $query->where('home_id', '=', $team_id) + ->orWhere('away_id', '=', $team_id); } - })->when($matches_played, function ($query) use ($matches_played, $player_on_field) { + }) + ->when($matches_played, function ($query) use ($matches_played, $player_on_field) { if ($player_on_field == 'notplayed') { return $query->whereNotIn('match_id', $matches_played); } else { return $query->whereIn('match_id', $matches_played); } - })->when($handicap_range, function ($query) use ($handicap_range) { + }) + ->when($handicap_range, function ($query) use ($handicap_range) { return $query->whereBetween('exp_handicap', $handicap_range); })->when($total_range, function ($query) use ($total_range) { return $query->whereBetween('exp_total', $total_range); diff --git a/resources/views/filament/pages/statistic.blade.php b/resources/views/filament/pages/statistic.blade.php index a043ee31..356887d5 100644 --- a/resources/views/filament/pages/statistic.blade.php +++ b/resources/views/filament/pages/statistic.blade.php @@ -1,5 +1,7 @@ @php -$player_name = App\Models\StatistikoDetail::where('ss_player_id', (int) $this->filters['ss_player_id'])->value('player_name'); + $player_name = App\Models\StatistikoDetail::where('ss_player_id', (int) $this->filters['ss_player_id'])->value( + 'player_name', + ); @endphp @@ -18,41 +20,44 @@ $player_name = App\Models\StatistikoDetail::where('ss_player_id', (int) $this->f Events Performance - @if($player_name) - - {{ $player_name }} - + @if ($player_name) + + {{ $player_name }} + - - {{ $player_name }} Performance - + + {{ $player_name }} Performance + @endif - -
- -
- @livewire(\App\Filament\Widgets\ChartEvent::class, ['filters' => $this->filters]) - @livewire(\App\Filament\Widgets\ChartEventMoAv::class, ['filters' => $this->filters]) -
- -
- @livewire(\App\Filament\Widgets\ChartEventPerf::class, ['filters' => $this->filters]) - @livewire(\App\Filament\Widgets\ChartEventPerfMoAv::class, ['filters' => $this->filters]) -
+ @if ($this->filters['team_id']) + +
+ +
+ @livewire(\App\Filament\Widgets\ChartEvent::class, ['filters' => $this->filters]) + @livewire(\App\Filament\Widgets\ChartEventMoAv::class, ['filters' => $this->filters]) +
-
- @livewire(\App\Filament\Widgets\ChartPlayer::class, ['filters' => $this->filters]) - @livewire(\App\Filament\Widgets\ChartPlayerMoAv::class, ['filters' => $this->filters]) -
+ +
+ @livewire(\App\Filament\Widgets\ChartEventPerf::class, ['filters' => $this->filters]) + @livewire(\App\Filament\Widgets\ChartEventPerfMoAv::class, ['filters' => $this->filters]) +
-
- @livewire(\App\Filament\Widgets\ChartPlayerPerf::class, ['filters' => $this->filters]) - @livewire(\App\Filament\Widgets\ChartPlayerPerfMoAv::class, ['filters' => $this->filters]) +
+ @livewire(\App\Filament\Widgets\ChartPlayer::class, ['filters' => $this->filters]) + @livewire(\App\Filament\Widgets\ChartPlayerMoAv::class, ['filters' => $this->filters]) +
+ +
+ @livewire(\App\Filament\Widgets\ChartPlayerPerf::class, ['filters' => $this->filters]) + @livewire(\App\Filament\Widgets\ChartPlayerPerfMoAv::class, ['filters' => $this->filters]) +
-
+ @endif
-
\ No newline at end of file +