mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
fix notification counter on entity
This commit is contained in:
parent
83dd8f810c
commit
529a9e5f58
@ -56,7 +56,7 @@ final class NotificationRepository implements ObjectRepository
|
|||||||
if (null === $this->notificationByRelatedEntityAndUserAssociatedStatement) {
|
if (null === $this->notificationByRelatedEntityAndUserAssociatedStatement) {
|
||||||
$sql =
|
$sql =
|
||||||
'SELECT
|
'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,
|
SUM((cmn.sender_id = :userid)::int) AS sent,
|
||||||
COUNT(cmn.*) AS total
|
COUNT(cmn.*) AS total
|
||||||
FROM chill_main_notification cmn
|
FROM chill_main_notification cmn
|
||||||
|
Loading…
x
Reference in New Issue
Block a user