0
在Moodle表格中,我想根據隊列名稱對列進行排序,但它仍然保持對隊列的排序。在url結尾保持& tsort = cohortid。在隊列名稱而不是隊列名稱的Moodle表格中排序
我在函數中的代碼是在下面,將會有什麼必要的改變?
global $DB;
$rs = array();
$records = $DB->get_records_sql("SELECT c.id, c.name FROM {cohort} c
LEFT JOIN {block_name_of_block} b ON b.cohortid = c.id
WHERE b.cohortid = ?
ORDER BY c.name ASC
", array($values->cohortid, $sort='c.name'));
foreach ($records as $record) {
$rs[] = $record->name;
}
return .. (=url)