Skip to content

Commit

Permalink
distinct when filtering on man
Browse files Browse the repository at this point in the history
  • Loading branch information
nateiler committed Jan 25, 2019
1 parent 15b3fd7 commit 1cf631e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/queries/OrganizationQuery.php
Expand Up @@ -234,7 +234,10 @@ protected function applyTypeParam()
}

$alias = $this->joinOrganizationTypeTable();
$this->subQuery->andWhere(

$this->subQuery
->distinct(true)
->andWhere(
Db::parseParam($alias . '.typeId', $this->parseOrganizationTypeValue($this->organizationType))
);
}
Expand Down
16 changes: 8 additions & 8 deletions src/queries/UserQueryParamHandler.php
Expand Up @@ -158,14 +158,14 @@ protected function applyUserTypeParam(UserQuery $query, $type)
return;
}

$query->subQuery->distinct(true);

$this->joinOrganizationUserTypeTable($query->subQuery);
$query->subQuery->andWhere(
Db::parseParam(
UserCollectionUsersRecord::tableAlias() . '.typeId',
$this->parseUserTypeValue($type)
)
);
$query->subQuery
->distinct(true)
->andWhere(
Db::parseParam(
UserCollectionUsersRecord::tableAlias() . '.typeId',
$this->parseUserTypeValue($type)
)
);
}
}

0 comments on commit 1cf631e

Please sign in to comment.