From 2495c1ee9a94c344b4450e91008a54a3290de59a Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 23 Mar 2024 16:33:26 -0400 Subject: [PATCH] Fix incorrect page count for weekly rankings --- db/daily.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/daily.go b/db/daily.go index aa24636..f0a372e 100644 --- a/db/daily.go +++ b/db/daily.go @@ -65,7 +65,7 @@ func FetchRankingPageCount(category int) (int, error) { case 0: query = "SELECT COUNT(a.username) FROM accountDailyRuns adr JOIN dailyRuns dr ON dr.date = adr.date JOIN accounts a ON adr.uuid = a.uuid WHERE dr.date = UTC_DATE()" case 1: - query = "SELECT COUNT(a.username) FROM accountDailyRuns adr JOIN dailyRuns dr ON dr.date = adr.date JOIN accounts a ON adr.uuid = a.uuid WHERE dr.date >= DATE_SUB(DATE(UTC_TIMESTAMP()), INTERVAL DAYOFWEEK(UTC_TIMESTAMP()) - 1 DAY)" + query = "SELECT COUNT(DISTINCT a.username) FROM accountDailyRuns adr JOIN dailyRuns dr ON dr.date = adr.date JOIN accounts a ON adr.uuid = a.uuid WHERE dr.date >= DATE_SUB(DATE(UTC_TIMESTAMP()), INTERVAL DAYOFWEEK(UTC_TIMESTAMP()) - 1 DAY)" } err := handle.QueryRow(query).Scan(&recordCount)