diff options
Diffstat (limited to 'juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java')
-rw-r--r-- | juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java index c23b04e4..430039ea 100644 --- a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -286,9 +286,9 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ @Override public com.juick.Message getMessage(final int mid) { List<com.juick.Message> list = getJdbcTemplate().query( - "SELECT messages.message_id, 0 as rid, 0 as replyto, " - + "messages.user_id, users.nick, users.banned as banned, " - + "TIMESTAMPDIFF(MINUTE, messages.ts, NOW())," + "SELECT messages.message_id as mid, 0 as rid, 0 as replyto, " + + "messages.user_id as uid, users.nick, users.banned as banned, " + + "TIMESTAMPDIFF(MINUTE, messages.ts, NOW()) as ago," + "messages.ts," + "messages.readonly, messages.privacy, messages.replies," + "messages.attach, messages.place_id, messages.lat," @@ -299,7 +299,9 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ + "ON messages.message_id = txt.message_id " + "LEFT JOIN favorites " + "ON messages.message_id = favorites.message_id " - + "WHERE messages.message_id = ?", + + "WHERE messages.message_id = ? " + + "GROUP BY mid, rid, replyto, uid, nick, banned, ago, ts, readonly, " + + "privacy, replies, attach, place_id, lat, lon, tags, repliesby, q", new MessageMapper(), mid); |