diff --git a/app/Http/Controllers/StartController.php b/app/Http/Controllers/StartController.php index 784effef..26733ae1 100644 --- a/app/Http/Controllers/StartController.php +++ b/app/Http/Controllers/StartController.php @@ -135,7 +135,7 @@ public function day(Request $request, $date = null) $afterDate = $date['date']->format('Y-m-d'); $events = CrimeEvent::where('created_at', '<', $beforeDate) - ->where('parsed_date', '>', $afterDate) + ->where('created_at', '>', $afterDate) ->orderBy("parsed_date", "desc") ->with('locations') ->get(); @@ -143,7 +143,7 @@ public function day(Request $request, $date = null) $mostCommonCrimeTypes = CrimeEvent::selectRaw( 'parsed_title, count(id) as antal' ) - ->where('parsed_date', '<', $beforeDate) + ->where('created_at', '<', $beforeDate) ->where('parsed_date', '>', $afterDate) ->groupBy('parsed_title') ->orderByRaw('antal DESC') @@ -323,7 +323,7 @@ function getEventsForToday($date, $daysBack = 3) ->format('Y-m-d'); $events = CrimeEvent::where('created_at', '<', $beforeDate) - ->where('parsed_date', '>', $afterDate) + ->where('created_at', '>', $afterDate) ->orderBy("parsed_date", "desc") ->with('locations') ->limit(300)