mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
Fix user searching
This commit is contained in:
parent
6c0f694354
commit
d2bbb69a3a
|
@ -10,6 +10,8 @@ class UserSearcher implements SearcherInterface
|
||||||
{
|
{
|
||||||
protected $query;
|
protected $query;
|
||||||
|
|
||||||
|
protected $activeGambits = [];
|
||||||
|
|
||||||
protected $gambits;
|
protected $gambits;
|
||||||
|
|
||||||
protected $users;
|
protected $users;
|
||||||
|
@ -32,6 +34,16 @@ class UserSearcher implements SearcherInterface
|
||||||
return $this->query->getQuery();
|
return $this->query->getQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function addActiveGambit($gambit)
|
||||||
|
{
|
||||||
|
$this->activeGambits[] = $gambit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getActiveGambits()
|
||||||
|
{
|
||||||
|
return $this->activeGambits;
|
||||||
|
}
|
||||||
|
|
||||||
public function search(UserSearchCriteria $criteria, $limit = null, $offset = 0, $load = [])
|
public function search(UserSearchCriteria $criteria, $limit = null, $offset = 0, $load = [])
|
||||||
{
|
{
|
||||||
$this->user = $criteria->user;
|
$this->user = $criteria->user;
|
||||||
|
@ -64,7 +76,7 @@ class UserSearcher implements SearcherInterface
|
||||||
|
|
||||||
$users = $this->query->get();
|
$users = $this->query->get();
|
||||||
|
|
||||||
if ($count > 0 && $areMoreResults = $users->count() > $count) {
|
if ($limit > 0 && $areMoreResults = $users->count() > $limit) {
|
||||||
$users->pop();
|
$users->pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user