CEIL() uses fixed with new DML stuff. MDL-15336
This commit is contained in:
+4
-4
@@ -631,7 +631,7 @@ function stats_cron_weekly() {
|
||||
/// now enrolments averages
|
||||
$sql = "INSERT INTO {stats_weekly} (stattype, timeend, courseid, roleid, stat1, stat2)
|
||||
|
||||
SELECT 'enrolments', ntimeend, courseid, roleid, CEIL(AVG(stat1)), CEIL(AVG(stat2))
|
||||
SELECT 'enrolments', ntimeend, courseid, roleid, " . $DB->sql_ceil('AVG(stat1)') . ", " . $DB->sql_ceil('AVG(stat2)') . "
|
||||
FROM (
|
||||
SELECT $nextstartweek AS ntimeend, courseid, roleid, stat1, stat2
|
||||
FROM {stats_daily} sd
|
||||
@@ -761,7 +761,7 @@ function stats_cron_monthly() {
|
||||
/// now enrolments averages
|
||||
$sql = "INSERT INTO {stats_monthly} (stattype, timeend, courseid, roleid, stat1, stat2)
|
||||
|
||||
SELECT 'enrolments', ntimeend, courseid, roleid, CEIL(AVG(stat1)), CEIL(AVG(stat2))
|
||||
SELECT 'enrolments', ntimeend, courseid, roleid, " . $DB->sql_ceil('AVG(stat1)') . ", " . $DB->sql_ceil('AVG(stat2)') . "
|
||||
FROM (
|
||||
SELECT $nextstartmonth AS ntimeend, courseid, roleid, stat1, stat2
|
||||
FROM {stats_daily} sd
|
||||
@@ -1179,8 +1179,8 @@ function stats_get_parameters($time,$report,$courseid,$mode,$roleid=0) {
|
||||
$threshold = $CFG->statsuserthreshold;
|
||||
}
|
||||
$param->fields = '';
|
||||
$param->sql = 'SELECT courseid, ceil(avg(all_enrolments)) as line1,
|
||||
ceil(avg(active_enrolments)) as line2, avg(proportion_active) AS line3
|
||||
$param->sql = 'SELECT courseid, ' . $DB->sql_ceil('avg(all_enrolments)') . ' as line1, ' .
|
||||
$DB->sql_ceil('avg(active_enrolments)') . ' as line2, avg(proportion_active) AS line3
|
||||
FROM (
|
||||
SELECT courseid, timeend, stat2 as active_enrolments,
|
||||
stat1 as all_enrolments, '.$DB->sql_cast_char2real('stat2').'/'.$DB->sql_cast_char2real('stat1').' AS proportion_active
|
||||
|
||||
Reference in New Issue
Block a user