changes Ubaldo before Logomatic
This commit is contained in:
1 parent
498660e9cc
commit
f9e8b17d58
11 files changed
+607
-843
No files matched your search
@@ -48,17 +48,23 @@ class LoadEventsQueryAll
|
||||
$matches_played = [];
|
||||
|
||||
if ($ss_player_id) {
|
||||
// $matches_season = StatistikoEvent::whereIn('season', $season)
|
||||
// ->where(function ($query) use ($team_id, $team_position) {
|
||||
// switch ($team_position) {
|
||||
// case 'home':
|
||||
// return $query->where('home_id', '=', $team_id);
|
||||
// case 'away':
|
||||
// return $query->where('away_id', '=', $team_id);
|
||||
// default:
|
||||
// return $query->where('home_id', '=', $team_id)
|
||||
// ->orWhere('away_id', '=', $team_id);
|
||||
// }
|
||||
// })->pluck('match_id')->toArray();
|
||||
|
||||
$matches_season = StatistikoEvent::whereIn('season', $season)
|
||||
->where(function ($query) use ($team_id, $team_position) {
|
||||
switch ($team_position) {
|
||||
case 'home':
|
||||
return $query->where('home_id', '=', $team_id);
|
||||
case 'away':
|
||||
return $query->where('away_id', '=', $team_id);
|
||||
default:
|
||||
return $query->where('home_id', '=', $team_id)
|
||||
->orWhere('away_id', '=', $team_id);
|
||||
}
|
||||
->where(function ($query) use ($team_id) {
|
||||
return $query->where('home_id', '=', $team_id)
|
||||
->orWhere('away_id', '=', $team_id);
|
||||
})->pluck('match_id')->toArray();
|
||||
|
||||
$matches_played = StatistikoPlayer::query()
|
||||
@@ -101,19 +107,23 @@ class LoadEventsQueryAll
|
||||
return $query->where('league_id', $league_id);
|
||||
}
|
||||
})
|
||||
->where(function ($query) use ($team_id, $similar_past_matches, $team_position) {
|
||||
if ($team_id && $similar_past_matches == 'none') {
|
||||
switch ($team_position) {
|
||||
case 'home':
|
||||
return $query->where('home_id', '=', $team_id);
|
||||
case 'away':
|
||||
return $query->where('away_id', '=', $team_id);
|
||||
default:
|
||||
return $query->where('home_id', '=', $team_id)
|
||||
->orWhere('away_id', '=', $team_id);
|
||||
}
|
||||
}
|
||||
->where(function ($query) use ($team_id) {
|
||||
return $query->where('home_id', '=', $team_id)
|
||||
->orWhere('away_id', '=', $team_id);
|
||||
})
|
||||
// ->where(function ($query) use ($team_id, $similar_past_matches, $team_position) {
|
||||
// if ($team_id && $similar_past_matches == 'none') {
|
||||
// switch ($team_position) {
|
||||
// case 'home':
|
||||
// return $query->where('home_id', '=', $team_id);
|
||||
// case 'away':
|
||||
// return $query->where('away_id', '=', $team_id);
|
||||
// default:
|
||||
// return $query->where('home_id', '=', $team_id)
|
||||
// ->orWhere('away_id', '=', $team_id);
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
->when($matches_played, function ($query) use ($matches_played, $player_on_field) {
|
||||
if ($player_on_field == 'notplayed') {
|
||||
return $query->whereNotIn('match_id', $matches_played);
|
||||
|
||||
Reference in new issue
Block a user