multiple assignments should only be counted once

This commit is contained in:
toyomoyo
2006-12-06 04:26:50 +00:00
parent 91607e97ed
commit ae9910b3aa
+2 -2
View File
@@ -336,7 +336,7 @@
}
$select = 'SELECT u.id, u.username, u.firstname, u.lastname, u.email, u.city, u.country,
u.picture, u.lang, u.timezone, u.emailstop, u.maildisplay, ul.timeaccess AS lastaccess '; // s.lastaccess
//$select .= $course->enrolperiod?', s.timeend ':'';
$select .= $course->enrolperiod?', r.timeend ':'';
$from = "FROM {$CFG->prefix}user u INNER JOIN
{$CFG->prefix}role_assignments r on u.id=r.userid LEFT OUTER JOIN
{$CFG->prefix}user_lastaccess ul on (r.userid=ul.userid and ul.courseid = $course->id)";
@@ -391,7 +391,7 @@
$sort = '';
}
$matchcount = count_records_sql('SELECT COUNT(*) '.$from.$where.$wheresearch);
$matchcount = count_records_sql('SELECT COUNT(distinct u.id) '.$from.$where.$wheresearch);
$table->initialbars($totalcount > $perpage);
$table->pagesize($perpage, $matchcount);