mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-63785 profilefield_text: performance improvement
This commit is contained in:
parent
2b1efa16da
commit
10bbc95e03
1 changed files with 7 additions and 11 deletions
|
@ -95,22 +95,18 @@ class provider implements
|
|||
return;
|
||||
}
|
||||
|
||||
$params = [
|
||||
'contextuser' => CONTEXT_USER,
|
||||
'contextid' => $context->id,
|
||||
'datatype' => 'text'
|
||||
];
|
||||
|
||||
$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' => 'text'
|
||||
];
|
||||
|
||||
$userlist->add_from_sql('userid', $sql, $params);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue