mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-28248 completion: Incorrect SQL for finding enrol start date
This commit is contained in:
parent
4f3632441a
commit
b58f4df6ea
1 changed files with 6 additions and 1 deletions
|
@ -90,7 +90,12 @@ class completion_criteria_duration extends completion_criteria {
|
|||
private function get_timeenrolled($completion) {
|
||||
global $DB;
|
||||
|
||||
return $DB->get_field('user_enrolments', 'timestart', array('courseid' => $this->course, 'userid' => $completion->userid));
|
||||
return $DB->get_field_sql('
|
||||
SELECT eu.timestart
|
||||
FROM {user_enrolments} eu
|
||||
JOIN {enrol} e ON eu.enrolid = e.id
|
||||
WHERE e.courseid = ?
|
||||
AND eu.userid = ?', array($this->course, $completion->userid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue