From 0210f8aa2a541a40faafdec3d8d92058f51a6b26 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 18 Sep 2023 00:25:01 -0600 Subject: [PATCH] Update NotificationService, fix order bug --- app/Services/NotificationService.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Services/NotificationService.php b/app/Services/NotificationService.php index 81ac0b912..c068f8278 100644 --- a/app/Services/NotificationService.php +++ b/app/Services/NotificationService.php @@ -58,6 +58,7 @@ class NotificationService { $stop = $stop > 400 ? 400 : $stop; $ids = Notification::where('id', '>', self::getEpochId()) ->where('profile_id', $id) + ->orderByDesc('id') ->skip($start) ->take($stop) ->pluck('id'); @@ -281,6 +282,7 @@ class NotificationService { if(self::count($id) == 0 || $force == true) { $ids = Notification::where('profile_id', $id) ->where('id', '>', self::getEpochId()) + ->orderByDesc('id') ->limit($stop) ->pluck('id'); foreach($ids as $key) {