mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-63785 core_portfolio: performance improvement
This commit is contained in:
parent
cb624f41d8
commit
28dfbe77bf
@ -113,27 +113,16 @@ class provider implements
|
||||
return;
|
||||
}
|
||||
|
||||
$params = [
|
||||
'contextid' => $context->id,
|
||||
'contextuser' => CONTEXT_USER,
|
||||
];
|
||||
|
||||
$sql = "SELECT ctx.instanceid as userid
|
||||
FROM {portfolio_instance_user} piu
|
||||
JOIN {context} ctx
|
||||
ON ctx.instanceid = piu.userid
|
||||
AND ctx.contextlevel = :contextuser
|
||||
WHERE ctx.id = :contextid";
|
||||
$params = [$context->instanceid];
|
||||
|
||||
$sql = "SELECT userid
|
||||
FROM {portfolio_instance_user}
|
||||
WHERE userid = ?";
|
||||
$userlist->add_from_sql('userid', $sql, $params);
|
||||
|
||||
$sql = "SELECT ctx.instanceid as userid
|
||||
FROM {portfolio_log} pl
|
||||
JOIN {context} ctx
|
||||
ON ctx.instanceid = pl.userid
|
||||
AND ctx.contextlevel = :contextuser
|
||||
WHERE ctx.id = :contextid";
|
||||
|
||||
$sql = "SELECT userid
|
||||
FROM {portfolio_log}
|
||||
WHERE userid = ?";
|
||||
$userlist->add_from_sql('userid', $sql, $params);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user