Skip to content

Commit

Permalink
sameip: поиск пользователей включаем топики
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcom committed Jan 19, 2024
1 parent ead65a4 commit 63c3d84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/ru/org/linux/user/UserDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,8 @@ public List<UserAndAgent> getUsersWithAgent(@Nullable String ip, @Nullable Integ

return namedJdbcTemplate.query(
"SELECT MAX(c.postdate) AS lastdate, u.nick, c.ua_id, ua.name AS user_agent, blocked " +
"FROM comments c LEFT JOIN user_agents ua ON c.ua_id = ua.id " +
"FROM (SELECT ua_id, userid, postdate FROM comments UNION ALL SELECT ua_id, userid, postdate FROM topics) c " +
"LEFT JOIN user_agents ua ON c.ua_id = ua.id " +
"JOIN users u ON c.userid = u.id " +
"WHERE c.postdate>CURRENT_TIMESTAMP - '1 year'::interval " +
ipQuery +
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/sameip.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%@ taglib tagdir="/WEB-INF/tags" prefix="lor" %>
<%@ taglib prefix="l" uri="http://www.linux.org.ru" %>
<%--
~ Copyright 1998-2022 Linux.org.ru
~ Copyright 1998-2024 Linux.org.ru
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
Expand Down Expand Up @@ -235,7 +235,7 @@
</c:forEach>
</div>

<h2>Пользователи за год (по комментариям)
<h2>Пользователи за год (по топикам и комментариям)
<c:if test="${hasMoreUsers}">(показаны первые ${rowsLimit})</c:if>
</h2>
<div class=forum>
Expand Down

0 comments on commit 63c3d84

Please sign in to comment.