Permalink
Browse files

MDL-30003 fix earliest stat date fetching

  • Loading branch information...
1 parent c1dc3a5 commit 106357825e7839c9e9ac568660dee04b63498580 @skodak skodak committed Jan 15, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 course/user.php
View
@@ -200,9 +200,9 @@
echo $OUTPUT->notification($statsstatus);
}
- $earliestday = $DB->get_field_sql('SELECT timeend FROM {stats_user_daily} ORDER BY timeend');
- $earliestweek = $DB->get_field_sql('SELECT timeend FROM {stats_user_weekly} ORDER BY timeend');
- $earliestmonth = $DB->get_field_sql('SELECT timeend FROM {stats_user_monthly} ORDER BY timeend');
+ $earliestday = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_user_daily}');
+ $earliestweek = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_user_weekly}');
+ $earliestmonth = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_user_monthly}');
if (empty($earliestday)) $earliestday = time();
if (empty($earliestweek)) $earliestweek = time();

0 comments on commit 1063578

Please sign in to comment.