Skip to content

Commit c8a4bcc

Browse files
committed
modify: id값 오름차순 정렬 조건 추가
1 parent 0abed19 commit c8a4bcc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/repositories/leaderboard.repository.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class LeaderboardRepository {
2727
LEFT JOIN start_stats ss ON ss.post_id = p.id
2828
WHERE u.email IS NOT NULL
2929
GROUP BY u.id, u.email
30-
ORDER BY ${this.SORT_COL_MAPPING[sort]} DESC
30+
ORDER BY ${this.SORT_COL_MAPPING[sort]} DESC, u.id
3131
LIMIT $2;
3232
`;
3333
const result = await this.pool.query(query, [dateRange, limit]);
@@ -58,7 +58,7 @@ export class LeaderboardRepository {
5858
LEFT JOIN today_stats ts ON ts.post_id = p.id
5959
LEFT JOIN start_stats ss ON ss.post_id = p.id
6060
WHERE p.is_active = true
61-
ORDER BY ${this.SORT_COL_MAPPING[sort]} DESC
61+
ORDER BY ${this.SORT_COL_MAPPING[sort]} DESC, p.id
6262
LIMIT $2;
6363
`;
6464
const result = await this.pool.query(query, [dateRange, limit]);

0 commit comments

Comments
 (0)