Fix multiple rows per user appearing when using filters/sorts
This commit is contained in:
@@ -68,6 +68,8 @@ class User extends UFUser
|
||||
*/
|
||||
public function scopeJoinOrganisations($query)
|
||||
{
|
||||
$query = $query->select('users.*')->distinct();
|
||||
|
||||
$query = $query->leftJoin('organisation_members', 'organisation_members.user_id', '=', 'users.id');
|
||||
$query = $query->leftJoin('organisations', 'organisations.id', '=', 'organisation_members.organisation_id');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user