summaryrefslogtreecommitdiffstats
path: root/pages/memberlist.php
diff options
context:
space:
mode:
authorBlueRaja <BlueRaja.admin@gmail.com>2013-01-24 04:18:05 -0600
committerBlueRaja <BlueRaja.admin@gmail.com>2013-01-24 04:18:05 -0600
commit09d59e739812e353616359f4ef0f388ddefb1ae7 (patch)
treeca7a8edc8ae1dd57bf895d38d7e46f395e5f7300 /pages/memberlist.php
parentf0234144b924db7a9001da117cc9ff0fa3414ff6 (diff)
downloadpathery-09d59e739812e353616359f4ef0f388ddefb1ae7.tar.xz
'moves in past week' should correctly include weekly maps, even when offset by 12 hours
Diffstat (limited to 'pages/memberlist.php')
-rw-r--r--pages/memberlist.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/pages/memberlist.php b/pages/memberlist.php
index c447f1c..cf5f3bd 100644
--- a/pages/memberlist.php
+++ b/pages/memberlist.php
@@ -65,9 +65,13 @@ $sql = "SELECT
users.ID,
users.displayName,
users.totalMoves,
- (SELECT SUM(moves) FROM solutions
- WHERE solutions.userID = users.ID AND
- solutions.dateModified BETWEEN DATE_SUB(CURRENT_DATE, INTERVAL 7 DAY) AND CURRENT_DATE) AS totalMovesThisWeek,
+ (
+ SELECT SUM(moves)
+ FROM solutions
+ INNER JOIN mapOfTheDay ON solutions.mapID = mapOfTheDay.mapID
+ WHERE solutions.userID = users.ID
+ AND mapOfTheDay.mapExpireTime BETWEEN DATE_SUB(NOW(), INTERVAL 7 DAY) AND NOW()
+ ) AS totalMovesThisWeek,
users.totalMazes,
users.totalWins,
users.totalTies,