diff options
author | Vitaly Takmazov | 2018-04-15 22:44:44 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-04-15 22:44:44 +0300 |
commit | 2844b14f747d93aea3684d570be8d4a002c50ed2 (patch) | |
tree | 73b3662f4e08db3c263a91eee13907b7f1e94590 /juick-server-jdbc/src/main/java/com | |
parent | 312a462685fce047d4712780ae46f2b910f5d057 (diff) |
jdbc: fix top users query
Diffstat (limited to 'juick-server-jdbc/src/main/java/com')
-rw-r--r-- | juick-server-jdbc/src/main/java/com/juick/service/ShowQueriesServiceImpl.java | 4 |
1 files changed, 2 insertions, 2 deletions
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<String> 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)); } } |