mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 13:33:18 +00:00
Merge pull request #2150 from pixelfed/staging
Update SearchController, fix ranking bug
This commit is contained in:
commit
e553bfe30e
2 changed files with 6 additions and 2 deletions
|
@ -28,6 +28,7 @@
|
||||||
- Updated NotificationCard.vue component, add follow requests at top of card, remove card-header ([5e48ffca](https://github.com/pixelfed/pixelfed/commit/5e48ffca))
|
- Updated NotificationCard.vue component, add follow requests at top of card, remove card-header ([5e48ffca](https://github.com/pixelfed/pixelfed/commit/5e48ffca))
|
||||||
- Updated RemoteProfile.vue component, add warning for empty profiles and last_fetched_at ([66f44a9d](https://github.com/pixelfed/pixelfed/commit/66f44a9d))
|
- Updated RemoteProfile.vue component, add warning for empty profiles and last_fetched_at ([66f44a9d](https://github.com/pixelfed/pixelfed/commit/66f44a9d))
|
||||||
- Updated ApiV1Controller, enforce public timeline setting ([285bd485](https://github.com/pixelfed/pixelfed/commit/285bd485))
|
- Updated ApiV1Controller, enforce public timeline setting ([285bd485](https://github.com/pixelfed/pixelfed/commit/285bd485))
|
||||||
|
- Update SearchController, fix self search bug and rank local matches higher ([f67fada2](https://github.com/pixelfed/pixelfed/commit/f67fada2))
|
||||||
|
|
||||||
|
|
||||||
## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9)
|
## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9)
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue