From 529a9e5f58e188031ad250455e782b322e888af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 25 Apr 2022 16:34:49 +0200 Subject: [PATCH] fix notification counter on entity --- .../ChillMainBundle/Repository/NotificationRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php b/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php index 3f3b08f6c..b4ab74a25 100644 --- a/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php @@ -56,7 +56,7 @@ final class NotificationRepository implements ObjectRepository if (null === $this->notificationByRelatedEntityAndUserAssociatedStatement) { $sql = 'SELECT - SUM((EXISTS (SELECT 1 AS c FROM chill_main_notification_addresses_unread cmnau JOIN chill_main_notification cmn ON cmnau.notification_id = cmn.id WHERE user_id = :userid and cmnau.notification_id = cmn.id and cmn.sender_id IS NOT NULL))::int) AS unread, + SUM((EXISTS (SELECT 1 AS c FROM chill_main_notification_addresses_unread cmnau WHERE user_id = :userid and cmnau.notification_id = cmn.id))::int) AS unread, SUM((cmn.sender_id = :userid)::int) AS sent, COUNT(cmn.*) AS total FROM chill_main_notification cmn