Merged from MOODLE_14_STABLE: In get logs don't join on the user table for just counting the records
This commit is contained in:
+3
-1
@@ -2657,7 +2657,9 @@ function get_logs($select, $order='l.time DESC', $limitfrom='', $limitnum='', &$
|
||||
}
|
||||
|
||||
$selectsql = $CFG->prefix .'log l LEFT JOIN '. $CFG->prefix .'user u ON l.userid = u.id '. ((strlen($select) > 0) ? 'WHERE '. $select : '');
|
||||
$totalcount = count_records_sql('SELECT COUNT(*) FROM '. $selectsql);
|
||||
$countsql = $CFG->prefix.'log l '.((strlen($select) > 0) ? ' WHERE '. $select : '');
|
||||
|
||||
$totalcount = count_records_sql("SELECT COUNT(*) FROM $countsql");
|
||||
|
||||
return get_records_sql('SELECT l.*, u.firstname, u.lastname, u.picture
|
||||
FROM '. $selectsql .' '. $order .' '. $limit);
|
||||
|
||||
Reference in New Issue
Block a user