Forráskód Böngészése

Update DiscoverController

Daniel Supernault 4 éve
szülő
commit
e08f646008
1 módosított fájl, 4 hozzáadás és 2 törlés
  1. 4 2
      app/Http/Controllers/DiscoverController.php

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

@@ -181,11 +181,13 @@ class DiscoverController extends Controller
       $ttl = now()->addHours(2);
       $res = Cache::remember($key, $ttl, function() use($range) {
         if($range == '-1') {
-          $res = Status::orderBy('likes_count','desc')
+          $res = Status::whereVisibility('public')
+          ->orderBy('likes_count','desc')
           ->take(12)
           ->get();
         } else {
-          $res = Status::orderBy('likes_count','desc')
+          $res = Status::whereVisibility('public')
+          ->orderBy('likes_count','desc')
           ->take(12)
           ->where('created_at', '>', now()->subDays($range))
           ->get();