Commit d5d80686 authored by mmn's avatar mmn

Merge branch 'group-members-pending' into 'nightly'

Fix "pending members" group list

Related to #104 

See merge request !64
parents 5f0412b9 a06dc576
......@@ -220,24 +220,19 @@ class User_group extends Managed_DataObject
*/
function getRequests($offset=0, $limit=null)
{
$qry =
'SELECT profile.* ' .
'FROM profile JOIN group_join_queue '.
'ON profile.id = group_join_queue.profile_id ' .
'WHERE group_join_queue.group_id = %d ' .
'ORDER BY group_join_queue.created DESC ';
$rq = new Group_join_queue();
$rq->group_id = $this->id;
$members = new Profile();
$members->joinAdd(['id', $rq, 'profile_id']);
if ($limit != null) {
if (common_config('db','type') == 'pgsql') {
$qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
} else {
$qry .= ' LIMIT ' . $offset . ', ' . $limit;
}
$members->limit($offset, $limit);
}
$members = new Profile();
$members->find();
$members->query(sprintf($qry, $this->id));
return $members;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment