Selaa lähdekoodia

Update SearchController

Daniel Supernault 6 vuotta sitten
vanhempi
commit
5cfa7f877c
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      app/Http/Controllers/SearchController.php

+ 2 - 1
app/Http/Controllers/SearchController.php

@@ -22,7 +22,7 @@ class SearchController extends Controller
             return;
             return;
         }
         }
         $hash = hash('sha256', $tag);
         $hash = hash('sha256', $tag);
-        $tokens = Cache::remember('api:search:tag:'.$hash, 60, function () use ($tag) {
+        $tokens = Cache::remember('api:search:tag:'.$hash, 5, function () use ($tag) {
             $tokens = collect([]);
             $tokens = collect([]);
             $hashtags = Hashtag::select('id', 'name', 'slug')->where('slug', 'like', '%'.$tag.'%')->limit(20)->get();
             $hashtags = Hashtag::select('id', 'name', 'slug')->where('slug', 'like', '%'.$tag.'%')->limit(20)->get();
             if($hashtags->count() > 0) {
             if($hashtags->count() > 0) {
@@ -39,6 +39,7 @@ class SearchController extends Controller
                 $tokens->push($tags);
                 $tokens->push($tags);
             }
             }
             $users = Profile::select('username', 'name', 'id')
             $users = Profile::select('username', 'name', 'id')
+                ->whereNull('status')
                 ->where('username', 'like', '%'.$tag.'%')
                 ->where('username', 'like', '%'.$tag.'%')
                 ->limit(20)
                 ->limit(20)
                 ->get();
                 ->get();