wip
This commit is contained in:
1 parent
0e18be68f3
commit
f09f4f0dd0
3 files changed
+46
-37
No files matched your search
@@ -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>
|
||||
|
||||
@@ -18,41 +20,44 @@ $player_name = App\Models\StatistikoDetail::where('ss_player_id', (int) $this->f
|
||||
Events Performance
|
||||
</x-filament::tabs.item>
|
||||
|
||||
@if($player_name)
|
||||
<x-filament::tabs.item x-on:click="activeTab = 'tab3'" :alpine-active="'activeTab === \'' . 'tab3' . '\''" icon="icon-player">
|
||||
{{ $player_name }}
|
||||
</x-filament::tabs.item>
|
||||
@if ($player_name)
|
||||
<x-filament::tabs.item x-on:click="activeTab = 'tab3'" :alpine-active="'activeTab === \'' . 'tab3' . '\''" icon="icon-player">
|
||||
{{ $player_name }}
|
||||
</x-filament::tabs.item>
|
||||
|
||||
<x-filament::tabs.item x-on:click="activeTab = 'tab4'" :alpine-active="'activeTab === \'' . 'tab4' . '\''" icon="icon-player">
|
||||
{{ $player_name }} Performance
|
||||
</x-filament::tabs.item>
|
||||
<x-filament::tabs.item x-on:click="activeTab = 'tab4'" :alpine-active="'activeTab === \'' . 'tab4' . '\''" icon="icon-player">
|
||||
{{ $player_name }} Performance
|
||||
</x-filament::tabs.item>
|
||||
@endif
|
||||
|
||||
</x-filament::tabs>
|
||||
|
||||
<!-- Tab Content -->
|
||||
<div class="mt-2">
|
||||
<!-- Content for Tab 1 -->
|
||||
<div x-show="activeTab === 'tab1'" x-cloak class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@livewire(\App\Filament\Widgets\ChartEvent::class, ['filters' => $this->filters])
|
||||
@livewire(\App\Filament\Widgets\ChartEventMoAv::class, ['filters' => $this->filters])
|
||||
</div>
|
||||
|
||||
<!-- Content for Tab 2 -->
|
||||
<div x-show="activeTab === 'tab2'" x-cloak class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@livewire(\App\Filament\Widgets\ChartEventPerf::class, ['filters' => $this->filters])
|
||||
@livewire(\App\Filament\Widgets\ChartEventPerfMoAv::class, ['filters' => $this->filters])
|
||||
</div>
|
||||
@if ($this->filters['team_id'])
|
||||
<!-- Tab Content -->
|
||||
<div class="mt-2">
|
||||
<!-- Content for Tab 1 -->
|
||||
<div x-show="activeTab === 'tab1'" x-cloak class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@livewire(\App\Filament\Widgets\ChartEvent::class, ['filters' => $this->filters])
|
||||
@livewire(\App\Filament\Widgets\ChartEventMoAv::class, ['filters' => $this->filters])
|
||||
</div>
|
||||
|
||||
<div x-show="activeTab === 'tab3'" x-cloak class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@livewire(\App\Filament\Widgets\ChartPlayer::class, ['filters' => $this->filters])
|
||||
@livewire(\App\Filament\Widgets\ChartPlayerMoAv::class, ['filters' => $this->filters])
|
||||
</div>
|
||||
<!-- Content for Tab 2 -->
|
||||
<div x-show="activeTab === 'tab2'" x-cloak class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@livewire(\App\Filament\Widgets\ChartEventPerf::class, ['filters' => $this->filters])
|
||||
@livewire(\App\Filament\Widgets\ChartEventPerfMoAv::class, ['filters' => $this->filters])
|
||||
</div>
|
||||
|
||||
<div x-show="activeTab === 'tab4'" x-cloak class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@livewire(\App\Filament\Widgets\ChartPlayerPerf::class, ['filters' => $this->filters])
|
||||
@livewire(\App\Filament\Widgets\ChartPlayerPerfMoAv::class, ['filters' => $this->filters])
|
||||
<div x-show="activeTab === 'tab3'" x-cloak class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@livewire(\App\Filament\Widgets\ChartPlayer::class, ['filters' => $this->filters])
|
||||
@livewire(\App\Filament\Widgets\ChartPlayerMoAv::class, ['filters' => $this->filters])
|
||||
</div>
|
||||
|
||||
<div x-show="activeTab === 'tab4'" x-cloak class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@livewire(\App\Filament\Widgets\ChartPlayerPerf::class, ['filters' => $this->filters])
|
||||
@livewire(\App\Filament\Widgets\ChartPlayerPerfMoAv::class, ['filters' => $this->filters])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</x-filament-panels::page>
|
||||
</x-filament-panels::page>
|
||||
Reference in new issue
Block a user