wip
This commit is contained in:
1 parent
0e18be68f3
commit
f09f4f0dd0
3 files changed
+18
-9
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\LoadEventsQuery;
|
||||||
use App\Filament\Widgets\Data\LoadEvents\LoadExpectations;
|
use App\Filament\Widgets\Data\LoadEvents\LoadExpectations;
|
||||||
use App\Models\StatisticFixtures;
|
use App\Models\StatisticFixtures;
|
||||||
|
use App\Models\StatistikoEvent;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
class LoadEvents
|
class LoadEvents
|
||||||
@@ -65,6 +66,7 @@ class LoadEvents
|
|||||||
/**
|
/**
|
||||||
* STATTISTIC DATA
|
* STATTISTIC DATA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$res = LoadEventsQuery::load($filter, $handicap_range, $total_range, $match);
|
$res = LoadEventsQuery::load($filter, $handicap_range, $total_range, $match);
|
||||||
|
|
||||||
$dataset_home = [];
|
$dataset_home = [];
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class LoadEventsQuery
|
|||||||
$matches_played = [];
|
$matches_played = [];
|
||||||
|
|
||||||
if ($ss_player_id) {
|
if ($ss_player_id) {
|
||||||
|
dd('ss_player_id', $ss_player_id);
|
||||||
$matches_season = StatistikoEvent::where(function ($query) use ($team_id, $team_position) {
|
$matches_season = StatistikoEvent::where(function ($query) use ($team_id, $team_position) {
|
||||||
switch ($team_position) {
|
switch ($team_position) {
|
||||||
case 'home':
|
case 'home':
|
||||||
@@ -84,7 +85,8 @@ class LoadEventsQuery
|
|||||||
/**
|
/**
|
||||||
* STATTISTIC DATA
|
* 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) {
|
->where(function ($query) use ($league_id, $similar_past_matches) {
|
||||||
switch ($similar_past_matches) {
|
switch ($similar_past_matches) {
|
||||||
case 'none':
|
case 'none':
|
||||||
@@ -92,20 +94,20 @@ class LoadEventsQuery
|
|||||||
return $query->where('league_id', $league_id);
|
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') {
|
if ($similar_past_matches == 'none') {
|
||||||
return $query->where('home_id', '=', $home_id)
|
return $query->where('home_id', '=', $team_id)
|
||||||
->orWhere('away_id', '=', $home_id)
|
->orWhere('away_id', '=', $team_id);
|
||||||
->orWhere('home_id', '=', $away_id)
|
|
||||||
->orWhere('away_id', '=', $away_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') {
|
if ($player_on_field == 'notplayed') {
|
||||||
return $query->whereNotIn('match_id', $matches_played);
|
return $query->whereNotIn('match_id', $matches_played);
|
||||||
} else {
|
} else {
|
||||||
return $query->whereIn('match_id', $matches_played);
|
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);
|
return $query->whereBetween('exp_handicap', $handicap_range);
|
||||||
})->when($total_range, function ($query) use ($total_range) {
|
})->when($total_range, function ($query) use ($total_range) {
|
||||||
return $query->whereBetween('exp_total', $total_range);
|
return $query->whereBetween('exp_total', $total_range);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
@php
|
@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
|
@endphp
|
||||||
<x-filament-panels::page>
|
<x-filament-panels::page>
|
||||||
|
|
||||||
@@ -30,6 +32,8 @@ $player_name = App\Models\StatistikoDetail::where('ss_player_id', (int) $this->f
|
|||||||
|
|
||||||
</x-filament::tabs>
|
</x-filament::tabs>
|
||||||
|
|
||||||
|
|
||||||
|
@if ($this->filters['team_id'])
|
||||||
<!-- Tab Content -->
|
<!-- Tab Content -->
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<!-- Content for Tab 1 -->
|
<!-- 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])
|
@livewire(\App\Filament\Widgets\ChartPlayerPerfMoAv::class, ['filters' => $this->filters])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</x-filament-panels::page>
|
</x-filament-panels::page>
|
||||||
Reference in new issue
Block a user