This commit is contained in:
salam committed 2026-08-24 15:27:08 +02:00
1 parent 0e18be68f3
commit f09f4f0dd0
3 files changed
+18 -9

No files matched your search

+2
View File
@@ -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 = [];
@@ -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);
@@ -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
<x-filament-panels::page>
@@ -30,6 +32,8 @@ $player_name = App\Models\StatistikoDetail::where('ss_player_id', (int) $this->f
</x-filament::tabs>
@if ($this->filters['team_id'])
<!-- Tab Content -->
<div class="mt-2">
<!-- Content for Tab 1 -->
@@ -54,5 +58,6 @@ $player_name = App\Models\StatistikoDetail::where('ss_player_id', (int) $this->f
@livewire(\App\Filament\Widgets\ChartPlayerPerfMoAv::class, ['filters' => $this->filters])
</div>
</div>
@endif
</div>
</x-filament-panels::page>