Skip to content

Commit

Permalink
faster query for weekly stats
Browse files Browse the repository at this point in the history
  • Loading branch information
grandsbor committed Jul 16, 2015
1 parent 02509ca commit 3b70961
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lib_stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function get_user_stats($weekly=false, $team=0) {
$res = sql_query("
SELECT user_id, MAX(timestamp) AS last_time
FROM morph_annot_click_log
WHERE timestamp > UNIX_TIMESTAMP(NOW()) - ".SEC_PER_DAY." * ".($weekly ? "30" : "60")."
WHERE timestamp > UNIX_TIMESTAMP(NOW()) - ".SEC_PER_DAY." * ".($weekly ? "7" : "60")."
GROUP BY user_id
");
while ($r = sql_fetch_array($res)) {
Expand Down

0 comments on commit 3b70961

Please sign in to comment.