This commit is contained in:
salam committed 2026-10-09 13:02:44 +02:00
1 parent 8cb1d428cb
commit 0a936bc84b
6 files changed
+190 -100

No files matched your search

@@ -47,9 +47,11 @@ class LoadEventsQueryAll
if ($ss_player_id) {
$matches_season = StatistikoEvent::whereIn('season', $season)
->where(function ($query) use ($team_id) {
return $query->where('home_id', '=', $team_id)
->orWhere('away_id', '=', $team_id);
->where(function ($query) use ($match) {
return $query->where('home_id', '=', $match->home_id)
->orWhere('home_id', '=', $match->away_id)
->orWhere('away_id', '=', $match->home_id)
->orWhere('away_id', '=', $match->away_id);
})->pluck('match_id')->toArray();
$matches_played = StatistikoPlayer::query()
@@ -92,16 +94,14 @@ class LoadEventsQueryAll
return $query->where('league_id', $league_id);
}
})
->where(function ($query) use ($team_id, $similar_past_matches) {
if ($team_id && $similar_past_matches == 'none') {
return $query->where('home_id', '=', $team_id)
->orWhere('away_id', '=', $team_id);
->where(function ($query) use ($match, $similar_past_matches) {
if ($similar_past_matches == 'none') {
return $query->where('home_id', '=', $match->home_id)
->orWhere('home_id', '=', $match->away_id)
->orWhere('away_id', '=', $match->home_id)
->orWhere('away_id', '=', $match->away_id);
}
})
// ->when($team_id, function ($query) use ($team_id) {
// 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);