From 0520c2836f36b5a50d74aa6a40a0c2bb0a76f318 Mon Sep 17 00:00:00 2001 From: BlueRaja Date: Thu, 24 Jan 2013 04:32:28 -0600 Subject: NOW the memberlist should correctly display moves for weekly maps (even when offset by 12 hours) --- includes/datas.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'includes/datas.php') 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, -- cgit v1.2.3