mirror of
https://github.com/moodle/moodle.git
synced 2025-04-09 02:12:22 +02:00
MDL-82584 mod_workshop: Correct DB select fields
We cannot use the `DISTINCT` CLOB fields on Oracle. Instead of selecting all the fields, we just need to select the needed fields only
This commit is contained in:
parent
f29f2ad5d3
commit
ea4b1f8e7b
@ -3385,9 +3385,10 @@ class workshop {
|
||||
|
||||
// This is from enrollib.php:get_enrolled_join(). It says it's better for caching to use round.
|
||||
$now = round(time(), -2);
|
||||
$userfieldsapi = \core_user\fields::for_name()->with_userpic();
|
||||
|
||||
$sqlarray = [];
|
||||
$sqlarray['select'] = "SELECT DISTINCT u.*";
|
||||
$sqlarray['select'] = "SELECT DISTINCT u.id" . $userfieldsapi->get_sql('u')->selects;
|
||||
$sqlarray['from'] = "FROM {user} u";
|
||||
$sqlarray['join'] = [];
|
||||
$sqlarray['join'][] = "JOIN {user_enrolments} ue ON ue.userid = u.id";
|
||||
|
Loading…
x
Reference in New Issue
Block a user