mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-63785 profilefield_datetime: performance improvement
This commit is contained in:
parent
033a061a0a
commit
1ae48ab484
@ -96,22 +96,18 @@ class provider implements
|
||||
return;
|
||||
}
|
||||
|
||||
$params = [
|
||||
'contextuser' => CONTEXT_USER,
|
||||
'contextid' => $context->id,
|
||||
'datatype' => 'datetime'
|
||||
];
|
||||
|
||||
$sql = "SELECT ctx.instanceid as userid
|
||||
$sql = "SELECT uda.userid
|
||||
FROM {user_info_data} uda
|
||||
JOIN {user_info_field} uif
|
||||
ON uda.fieldid = uif.id
|
||||
JOIN {context} ctx
|
||||
ON ctx.instanceid = uda.userid
|
||||
AND ctx.contextlevel = :contextuser
|
||||
WHERE ctx.id = :contextid
|
||||
WHERE uda.userid = :userid
|
||||
AND uif.datatype = :datatype";
|
||||
|
||||
$params = [
|
||||
'userid' => $context->instanceid,
|
||||
'datatype' => 'datetime'
|
||||
];
|
||||
|
||||
$userlist->add_from_sql('userid', $sql, $params);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user