Merge pull request #902 from pixelfed/frontend-ui-refactor

Update SearchController
This commit is contained in:
daniel 2019-02-27 21:46:48 -07:00 committed by GitHub
commit 25153397cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,7 +54,7 @@ class SearchController extends Controller
}
}
$hashtags = Hashtag::select('id', 'name', 'slug')->where('slug', 'like', '%'.$tag.'%')->limit(20)->get();
$hashtags = Hashtag::select('id', 'name', 'slug')->where('slug', 'like', '%'.$tag.'%')->whereHas('posts')->limit(20)->get();
if($hashtags->count() > 0) {
$tags = $hashtags->map(function ($item, $key) {
return [