mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 05:25:08 +02:00
Applied DISTINCT as per Martin Langhoff's solution in MDL-11381
user/index: ensure each user appears only once in participants list Regardless of the number of enrolments, ensure we list a single entry per user using DISTINCT. Much easier to manage than a GROUP BY.
This commit is contained in:
parent
165088f687
commit
5f2a203fa0
@ -331,7 +331,7 @@
|
||||
}
|
||||
|
||||
if ($context->id != $frontpagectx->id) {
|
||||
$select = 'SELECT u.id, u.username, u.firstname, u.lastname,
|
||||
$select = 'SELECT DISTINCT u.id, u.username, u.firstname, u.lastname,
|
||||
u.email, u.city, u.country, u.picture,
|
||||
u.lang, u.timezone, u.emailstop, u.maildisplay, u.imagealt,
|
||||
COALESCE(ul.timeaccess, 0) AS lastaccess,
|
||||
@ -340,7 +340,7 @@
|
||||
ctx.depth AS ctxdepth, ctx.contextlevel AS ctxlevel ';
|
||||
$select .= $course->enrolperiod?', r.timeend ':'';
|
||||
} else {
|
||||
$select = 'SELECT u.id, u.username, u.firstname, u.lastname,
|
||||
$select = 'SELECT DISTINCT u.id, u.username, u.firstname, u.lastname,
|
||||
u.email, u.city, u.country, u.picture,
|
||||
u.lang, u.timezone, u.emailstop, u.maildisplay, u.imagealt,
|
||||
u.lastaccess,
|
||||
|
Loading…
x
Reference in New Issue
Block a user