wip
This commit is contained in:
1 parent
4b2a1c1b01
commit
f6f5dd0c7c
1 file changed
+9
-9
@@ -23,11 +23,11 @@ class LoadEventsQueryAll
|
||||
}
|
||||
$ss_player_id = (int) $filter['ss_player_id'] ?? 0;
|
||||
$player_on_field = $filter['player_on_field'] ?? 'all';
|
||||
$similar_past_matches = $filter['similar_past_matches'];
|
||||
$spm = $filter['similar_past_matches'];
|
||||
|
||||
$handicap_range = [];
|
||||
$total_range = [];
|
||||
if ($similar_past_matches != 'none') {
|
||||
if ($spm == 'league' or $spm == 'all') {
|
||||
$ss_player_id = 0;
|
||||
$exp_handicap = $match->exp_away - $match->exp_home;
|
||||
$exp_total = $match->exp_away + $match->exp_home;
|
||||
@@ -81,18 +81,18 @@ class LoadEventsQueryAll
|
||||
/**
|
||||
* STATTISTIC DATA
|
||||
*/
|
||||
// Log::debug('result', [$similar_past_matches, $team_id]);
|
||||
// Log::debug('result', [$spm, $team_id]);
|
||||
|
||||
return StatistikoEvent::with('home')->with('away')
|
||||
->where(function ($query) use ($league_id, $similar_past_matches) {
|
||||
switch ($similar_past_matches) {
|
||||
->where(function ($query) use ($league_id, $spm) {
|
||||
switch ($spm) {
|
||||
case 'none':
|
||||
case 'league':
|
||||
return $query->where('league_id', $league_id);
|
||||
}
|
||||
})
|
||||
->where(function ($query) use ($match, $similar_past_matches) {
|
||||
if ($similar_past_matches == 'none') {
|
||||
->where(function ($query) use ($match, $spm) {
|
||||
if ($spm == 'none') {
|
||||
return $query
|
||||
->where('home_id', $match->home_id)
|
||||
->orWhere('home_id', '=', $match->away_id)
|
||||
@@ -117,8 +117,8 @@ class LoadEventsQueryAll
|
||||
})->when($end, function ($query) use ($end) {
|
||||
return $query->whereDate('starttime', '<=', $end);
|
||||
})
|
||||
->when($season, function ($query) use ($season, $season_or_date, $similar_past_matches) {
|
||||
if ($similar_past_matches == 'none' && $season_or_date == 'season') {
|
||||
->when($season, function ($query) use ($season, $season_or_date, $spm) {
|
||||
if ($spm == 'none' && $season_or_date == 'season') {
|
||||
return $query->whereIn('season', $season);
|
||||
}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user