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);
|
||||
|
||||
Reference in new issue
Block a user