浏览代码

Update PublicApiController

Daniel Supernault 6 年之前
父节点
当前提交
e3c425e222
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      app/Http/Controllers/PublicApiController.php

+ 4 - 2
app/Http/Controllers/PublicApiController.php

@@ -457,10 +457,11 @@ class PublicApiController extends Controller
                       )->where('id', $dir, $id)
                       ->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
                       ->whereNotIn('profile_id', $filtered)
+                      ->whereNotNull('uri')
                       ->whereNull('in_reply_to_id')
                       ->whereNull('reblog_of_id')
                       ->whereVisibility('public')
-                      ->orderBy('created_at', 'desc')
+                      ->latest()
                       ->limit($limit)
                       ->get();
         } else {
@@ -484,8 +485,9 @@ class PublicApiController extends Controller
                       ->whereNotIn('profile_id', $filtered)
                       ->whereNull('in_reply_to_id')
                       ->whereNull('reblog_of_id')
+                      ->whereNotNull('uri')
                       ->whereVisibility('public')
-                      ->orderBy('created_at', 'desc')
+                      ->latest()
                       ->simplePaginate($limit);
         }