wip
This commit is contained in:
1 parent
e8dad96865
commit
1736ade495
1 file changed
+9
-4
@@ -202,16 +202,21 @@ trait PlayerQuery
|
|||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
$date = false;
|
||||||
|
if ($this->date_spliter != null) {
|
||||||
|
$date = Carbon::parse($this->date_spliter)->endOfDay();
|
||||||
|
}
|
||||||
|
|
||||||
return match ($part) {
|
return match ($part) {
|
||||||
1 => StatistikoPlayer::with('details')
|
1 => StatistikoPlayer::with('details')
|
||||||
->whereIn('ss_player_id', $player_ids)
|
->whereIn('ss_player_id', $player_ids)
|
||||||
->when($this->date_spliter, function ($query) {
|
->when($date, function ($query) use ($date) {
|
||||||
return $query->whereDate('starttime', '>', $this->date_spliter);
|
return $query->whereDate('starttime', '>', $date);
|
||||||
})->get(),
|
})->get(),
|
||||||
2 => StatistikoPlayer::with('details')
|
2 => StatistikoPlayer::with('details')
|
||||||
->whereIn('ss_player_id', $player_ids)
|
->whereIn('ss_player_id', $player_ids)
|
||||||
->when($this->season_selected, function ($query) {
|
->when($date, function ($query) use ($date) {
|
||||||
return $query->whereDate('starttime', '<=', $this->date_spliter);
|
return $query->whereDate('starttime', '<=', $date);
|
||||||
})->get(),
|
})->get(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user