fix: use querybuilder for user comparaison

pull/281/head
Sebastien Marinier 2024-05-15 17:26:56 +02:00
parent 0219cf5df0
commit 9538c35e79
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ class RoomMapper extends QBMapper {
/* @var $qb IQueryBuilder */
$qb = $this->db->getQueryBuilder();
$this->joinShares($qb)
->addSelect($qb->createFunction('min(case when `r`.`user_id` ='. $qb->createNamedParameter($userId).' then '.RoomShare::PERMISSION_ADMIN.' else `s`.`permission` end) as permission'))
->addSelect($qb->createFunction('min(case when '.$qb->expr()->eq('r.user_id', $qb->createNamedParameter($userId)).' then '.RoomShare::PERMISSION_ADMIN.' else `s`.`permission` end) as permission'))
->where(
$qb->expr()->orX(
$qb->expr()->eq('r.user_id', $qb->createNamedParameter($userId)),