mirror of
https://github.com/moodle/moodle.git
synced 2025-04-27 03:14:20 +02:00
Merged small speed improvements from STABLE
This commit is contained in:
parent
76e2bc3b77
commit
169fc66a15
@ -240,7 +240,9 @@
|
||||
/// Print out all the courses
|
||||
unset($course); // To avoid unwanted language effects later
|
||||
|
||||
$courses = get_courses_page($category->id, "c.sortorder ASC", "c.*", $totalcount, $page*$perpage, $perpage);
|
||||
$courses = get_courses_page($category->id, 'c.sortorder ASC',
|
||||
'c.id,c.sortorder,c.shortname,c.fullname,c.summary,c.visible',
|
||||
$totalcount, $page*$perpage, $perpage);
|
||||
$numcourses = count($courses);
|
||||
|
||||
if (!$courses) {
|
||||
|
@ -1972,7 +1972,7 @@ function get_courses($categoryid='all', $sort='c.sortorder ASC', $fields='c.*')
|
||||
$selectsql = $CFG->prefix .'course c ';
|
||||
}
|
||||
|
||||
$courses = get_records_sql('SELECT DISTINCT '. $fields .' FROM '. $selectsql .' ORDER BY '. $sort);
|
||||
$courses = get_records_sql('SELECT '. $fields .' FROM '. $selectsql .' ORDER BY '. $sort);
|
||||
|
||||
if ($courses and (!$hideallinvisible) and (!$showallinvisible)) { // For ordinary users we need to check visibility
|
||||
foreach ($courses as $key => $course) {
|
||||
@ -2038,7 +2038,7 @@ function get_courses_page($categoryid='all', $sort='c.sortorder ASC', $fields='c
|
||||
$selectsql = $CFG->prefix .'course c ';
|
||||
}
|
||||
|
||||
$courses = get_records_sql('SELECT DISTINCT '. $fields .' FROM '. $selectsql .' ORDER BY '. $sort);
|
||||
$courses = get_records_sql('SELECT '. $fields .' FROM '. $selectsql .' ORDER BY '. $sort);
|
||||
|
||||
if ($courses and (!$hideallinvisible) and (!$showallinvisible)) { // For ordinary users we need to check visibility
|
||||
foreach ($courses as $key => $course) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user