From 31cb8c7526b96c6577badb203a336685a806b802 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 12 May 2022 11:16:34 +0300 Subject: Update top criterias --- src/main/java/com/juick/service/MessagesServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/com/juick/service') diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java index 369c508e..4cbd09ee 100644 --- a/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -996,7 +996,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ + "INNER JOIN messages ON messages.message_id = favorites.message_id " + "LEFT JOIN messages_tags ON messages_tags.message_id = messages.message_id " + "WHERE COALESCE(messages_tags.tag_id, 0) != 2 AND favorites.ts > TIMESTAMPADD(HOUR, -2, CURRENT_TIMESTAMP) " - + "AND NOT EXISTS (SELECT 1 FROM favorites WHERE message_id = messages.message_id AND user_id = 2) GROUP BY messages.message_id HAVING COUNT(DISTINCT favorites.user_id) > 1;", + + "AND NOT EXISTS (SELECT 1 FROM favorites WHERE message_id = messages.message_id AND user_id = 2) GROUP BY messages.message_id HAVING COUNT(DISTINCT favorites.user_id) > 2;", Integer.class); } -- cgit v1.2.3