Skip to content

Commit

Permalink
Merge pull request #478 from danthe1st/fix-monthly-xp-leaderboard
Browse files Browse the repository at this point in the history
Fix offset in monthly XP leaderboard
  • Loading branch information
jasonlessenich authored Mar 31, 2024
2 parents 71f31e8 + c87c536 commit 2400772
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public int getNumberOfUsersWithHelpXPInLastMonth() {
public List<Pair<Long, Integer>> getTotalTransactionWeightsInLastMonth(int page, int pageSize) {
return jdbcTemplate.query("SELECT recipient, SUM(weight) experience FROM help_transaction WHERE created_at >= ? GROUP BY recipient ORDER BY experience DESC LIMIT ? OFFSET ?",
(rs, row) -> new Pair<>(rs.getLong(1), rs.getInt(2)),
LocalDateTime.now().minusDays(30), pageSize, page);
LocalDateTime.now().minusDays(30), pageSize, Math.max(0, (page * pageSize) - pageSize));
}

/**
Expand Down

0 comments on commit 2400772

Please sign in to comment.