From: moodler Date: Tue, 2 Oct 2007 06:18:30 +0000 (+0000) Subject: Applied DISTINCT as per Martin Langhoff's solution in MDL-11381 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5f2a203fa0404985798c197ab192a2df632782df;p=moodle.git 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. --- diff --git a/user/index.php b/user/index.php index f76090231d..c637b8422e 100644 --- a/user/index.php +++ b/user/index.php @@ -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,