Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-27696 datalib Fixed up misused params in get_logs_usercourse

  • Loading branch information...
commit c78b71efb6cc4b23f328acf3d074dff49dde83fd 1 parent 89b2800
@samhemelryk samhemelryk authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/datalib.php
View
10 lib/datalib.php
@@ -1844,13 +1844,15 @@ function get_logs_usercourse($userid, $courseid, $coursestart) {
$params['courseid'] = $courseid;
}
$params['userid'] = $userid;
- $params['coursestart'] = $coursestart;
+ $params['coursestart1'] = $coursestart;
+ $params['coursestart2'] = $coursestart;
+ $params['coursestart3'] = $coursestart;
- return $DB->get_records_sql("SELECT FLOOR((time - :coursestart)/". DAYSECS .") AS day, COUNT(*) AS num
+ return $DB->get_records_sql("SELECT FLOOR((time - :coursestart1)/". DAYSECS .") AS day, COUNT(*) AS num
FROM {log}
WHERE userid = :userid
- AND time > :coursestart $courseselect
- GROUP BY FLOOR((time - :coursestart)/". DAYSECS .")", $params);
+ AND time > :coursestart2 $courseselect
+ GROUP BY FLOOR((time - :coursestart3)/". DAYSECS .")", $params);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.