Always take "days of incidents to show" into account

No need to select everything when looking at past incidents, date range should always be taken into account as a global rule for frontend.
This commit is contained in:
Danijel K 2018-04-10 14:32:16 +02:00 committed by GitHub
parent 3c51e5115a
commit 4f0a28f8a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,6 +67,10 @@ class StatusPageController extends AbstractApiController
$allIncidentDays = Incident::where('visible', '>=', (int) !Auth::check())
->select('occurred_at')
->whereBetween('occurred_at', [
$endDate->format('Y-m-d').' 00:00:00',
$startDate->format('Y-m-d').' 23:59:59',
])
->distinct()
->orderBy('occurred_at', 'desc')
->get()