diff options
author | Vitaly Takmazov | 2016-12-01 19:49:19 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-01 19:49:19 +0300 |
commit | 2d5dfc2be23bbab03f8cba285d9255833d9b798c (patch) | |
tree | da4c959bb35e917df113577e5e708444ffdb845f | |
parent | 95ffca7d956bca661315310b54f7fa5e7bab6006 (diff) |
juick-server: fix popular query
-rw-r--r-- | juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java index 7ca49ea9..bd044866 100644 --- a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -513,7 +513,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ .addValue("before", before); return getNamedParameterJdbcTemplate().queryForList( - "SELECT m.message_id FROM m.messages WHERE m.privacy > 0 " + + "SELECT m.message_id FROM messages m WHERE m.privacy > 0 " + (before > 0 ? " AND m.message_id < :before " : "") + " AND m.popular > 0 AND NOT EXISTS (SELECT 1 FROM bl_users b WHERE b.user_id = :vid and b.bl_user_id = m.user_id) " + |