From 77d823a45473592d65cc96d4b74b622173d67e0e Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Mon, 23 Jan 2023 13:59:16 +0800 Subject: [PATCH] Fix tag query for autocomplete --- src/Repository/TagRepository.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Repository/TagRepository.php b/src/Repository/TagRepository.php index 83eb603..e958cc6 100644 --- a/src/Repository/TagRepository.php +++ b/src/Repository/TagRepository.php @@ -200,6 +200,7 @@ public function search(string $term, int $pageNum, int $pageSize, ?User $user = ->setParameter('q', "%$term%") ->andWhere('p.view_group IN (' . $groupList . ')') ->orderBy('t.title', 'DESC') + ->groupBy('t.id') ->setMaxResults($pageSize) ->setFirstResult(($pageNum - 1) * $pageSize) ->getQuery()