summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorBlueRaja <BlueRaja.admin@gmail.com>2013-01-24 04:32:28 -0600
committerBlueRaja <BlueRaja.admin@gmail.com>2013-01-24 04:32:28 -0600
commit0520c2836f36b5a50d74aa6a40a0c2bb0a76f318 (patch)
tree00d346e09f7114b6df1e8ff67fc4a9ccfec51c88 /includes
parent15826a7bb675c5ab9c407d9667d97aaf96d075ca (diff)
downloadpathery-0520c2836f36b5a50d74aa6a40a0c2bb0a76f318.tar.xz
NOW the memberlist should correctly display moves for weekly maps (even when offset by 12 hours)
Diffstat (limited to 'includes')
-rw-r--r--includes/datas.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/includes/datas.php b/includes/datas.php
index 6566b89..5dcbe1e 100644
--- a/includes/datas.php
+++ b/includes/datas.php
@@ -752,11 +752,13 @@ function getMembers($pageNumber = 1, $pageDivide = 50, $order = 'DESC', $orderBy
users.ID as ID,
users.displayName as display,
users.totalMoves,
- IfNull(
- (SELECT SUM(moves) FROM solutions
- WHERE solutions.userID = users.ID AND
- solutions.dateModified BETWEEN DATE_SUB(CURRENT_DATE, INTERVAL 7 DAY) AND CURRENT_DATE)
- , 0) AS totalMovesThisWeek,
+ (
+ SELECT IFNULL(SUM(moves),0)
+ 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.championPoints as championPoints,
users.totalMazes as totalMazes,
users.totalWins as totalWins,