Index: trunk/extensions/ContributionReporting/DailyTotal_body.php |
— | — | @@ -8,8 +8,8 @@ |
9 | 9 | |
10 | 10 | class SpecialDailyTotal extends IncludableSpecialPage { |
11 | 11 | |
12 | | - protected $sharedMaxAge = 300; // Cache for 5 minutes on the server side |
13 | | - protected $maxAge = 300; // Cache for 5 minutes on the client side |
| 12 | + protected $sharedMaxAge = 600; // Cache for 10 minutes on the server side |
| 13 | + protected $maxAge = 600; // Cache for 10 minutes on the client side |
14 | 14 | |
15 | 15 | /* Functions */ |
16 | 16 | |
— | — | @@ -102,10 +102,14 @@ |
103 | 103 | return $cache; |
104 | 104 | } |
105 | 105 | |
| 106 | + // We're only interested in donations from the past 2 days at most |
| 107 | + $recentTime = time() - 60 * 60 * 48; |
| 108 | + |
106 | 109 | // Use database |
107 | 110 | $dbr = efContributionReportingConnection(); |
108 | 111 | #$dbr = wfGetDB( DB_MASTER ); |
109 | 112 | $conditions = array( |
| 113 | + 'received > ' . $recentTime; |
110 | 114 | 'converted_amount >= ' . $egFundraiserStatisticsMinimum, |
111 | 115 | 'converted_amount <= ' . $egFundraiserStatisticsMaximum, |
112 | 116 | "DATE_FORMAT(CONVERT_TZ(FROM_UNIXTIME(received),'+00:00','$timeZoneOffset'),'%Y-%m-%d') = '$start'" |
— | — | @@ -116,10 +120,7 @@ |
117 | 121 | 'sum(converted_amount)' |
118 | 122 | ), |
119 | 123 | $conditions, |
120 | | - __METHOD__, |
121 | | - array( |
122 | | - 'ORDER BY' => 'received' |
123 | | - ) |
| 124 | + __METHOD__ |
124 | 125 | ); |
125 | 126 | $row = $dbr->fetchRow( $select ); |
126 | 127 | $total = $row['sum(converted_amount)']; |