소스 검색

Update ApiController

Daniel Supernault 5 년 전
부모
커밋
9a50a6f627
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      app/Http/Controllers/Api/ApiV1Controller.php

+ 2 - 2
app/Http/Controllers/Api/ApiV1Controller.php

@@ -1164,14 +1164,14 @@ class ApiV1Controller extends Controller
             $id = $min ?? $max;
             $notifications = Notification::whereProfileId($pid)
                 ->whereDate('created_at', '>', $timeago)
-                ->latest()
                 ->where('id', $dir, $id)
+                ->orderByDesc('created_at')
                 ->limit($limit)
                 ->get();
         } else {
             $notifications = Notification::whereProfileId($pid)
                 ->whereDate('created_at', '>', $timeago)
-                ->latest()
+                ->orderByDesc('created_at')
                 ->simplePaginate($limit);
         }
         $resource = new Fractal\Resource\Collection($notifications, new NotificationTransformer());