From 2844b14f747d93aea3684d570be8d4a002c50ed2 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 15 Apr 2018 22:44:44 +0300 Subject: jdbc: fix top users query --- .../src/main/java/com/juick/service/ShowQueriesServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'juick-server-jdbc/src') diff --git a/juick-server-jdbc/src/main/java/com/juick/service/ShowQueriesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/ShowQueriesServiceImpl.java index e6d43710..0fba35f1 100644 --- a/juick-server-jdbc/src/main/java/com/juick/service/ShowQueriesServiceImpl.java +++ b/juick-server-jdbc/src/main/java/com/juick/service/ShowQueriesServiceImpl.java @@ -51,12 +51,12 @@ public class ShowQueriesServiceImpl extends BaseJdbcService implements ShowQueri @Override public List getTopUsers() { - return getJdbcTemplate().queryForList( + return getJdbcTemplate().query( "SELECT users.nick,COUNT(subscr_users.suser_id) AS cnt " + "FROM (subscr_users INNER JOIN users ON subscr_users.user_id=users.id) " + "INNER JOIN useroptions ON users.id=useroptions.user_id " + "WHERE useroptions.privacy_view>0 AND users.lastmessage > UNIX_TIMESTAMP() - 259200 " + "AND users.id!=2 GROUP BY subscr_users.user_id ORDER BY cnt DESC LIMIT 10", - String.class); + (rs, rowNum) -> rs.getString(1)); } } -- cgit v1.2.3