|
@@ -194,11 +194,14 @@ class SearchController extends Controller
|
|
|
|
|
|
else {
|
|
else {
|
|
$this->tokens['profiles'] = Cache::remember($key, $ttl, function() use($tag) {
|
|
$this->tokens['profiles'] = Cache::remember($key, $ttl, function() use($tag) {
|
|
- $users = Profile::select('domain', 'username', 'name', 'id')
|
|
|
|
|
|
+ if(Str::startsWith($tag, '@')) {
|
|
|
|
+ $tag = substr($tag, 1);
|
|
|
|
+ }
|
|
|
|
+ $users = Profile::select('status', 'domain', 'username', 'name', 'id')
|
|
->whereNull('status')
|
|
->whereNull('status')
|
|
- ->where('id', '!=', Auth::user()->profile->id)
|
|
|
|
->where('username', 'like', '%'.$tag.'%')
|
|
->where('username', 'like', '%'.$tag.'%')
|
|
->limit(20)
|
|
->limit(20)
|
|
|
|
+ ->orderBy('domain')
|
|
->get();
|
|
->get();
|
|
|
|
|
|
if($users->count() > 0) {
|
|
if($users->count() > 0) {
|