mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-25708 recordsets - survey module
This commit is contained in:
parent
676874df1d
commit
a1d870aa95
@ -232,13 +232,15 @@ function survey_print_recent_activity($course, $viewfullnames, $timestart) {
|
||||
|
||||
$slist = implode(',', $ids); // there should not be hundreds of glossaries in one course, right?
|
||||
|
||||
if (!$rs = $DB->get_recordset_sql("SELECT sa.userid, sa.survey, MAX(sa.time) AS time,
|
||||
u.firstname, u.lastname, u.email, u.picture
|
||||
FROM {survey_answers} sa
|
||||
JOIN {user} u ON u.id = sa.userid
|
||||
WHERE sa.survey IN ($slist) AND sa.time > ?
|
||||
GROUP BY sa.userid, sa.survey, u.firstname, u.lastname, u.email, u.picture
|
||||
ORDER BY time ASC", array($timestart))) {
|
||||
$rs = $DB->get_recordset_sql("SELECT sa.userid, sa.survey, MAX(sa.time) AS time,
|
||||
u.firstname, u.lastname, u.email, u.picture
|
||||
FROM {survey_answers} sa
|
||||
JOIN {user} u ON u.id = sa.userid
|
||||
WHERE sa.survey IN ($slist) AND sa.time > ?
|
||||
GROUP BY sa.userid, sa.survey, u.firstname, u.lastname, u.email, u.picture
|
||||
ORDER BY time ASC", array($timestart));
|
||||
if (!$rs->valid()) {
|
||||
$rs->close(); // Not going to iterate (but exit), close rs
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user