This commit is contained in:
PMKuipers 2024-05-22 23:24:06 +02:00
parent ff9044ae9a
commit 5dc94a7525

View file

@ -671,7 +671,7 @@ class studyplan {
$sql = "SELECT s.id FROM {local_treestudyplan} s $sql = "SELECT s.id FROM {local_treestudyplan} s
INNER JOIN {local_treestudyplan_cohort} j ON j.studyplan_id = s.id INNER JOIN {local_treestudyplan_cohort} j ON j.studyplan_id = s.id
INNER JOIN {cohort_members} cm ON j.cohort_id = cm.cohortid INNER JOIN {cohort_members} cm ON j.cohort_id = cm.cohortid
INNER JOIN {user} u ON cm.userid = user.id INNER JOIN {user} u ON cm.userid = u.id
WHERE cm.userid = :userid AND u.deleted != 1"; WHERE cm.userid = :userid AND u.deleted != 1";
$cohortplanids = $DB->get_fieldset_sql($sql, ['userid' => $userid]); $cohortplanids = $DB->get_fieldset_sql($sql, ['userid' => $userid]);
@ -705,7 +705,7 @@ class studyplan {
$sql = "SELECT COUNT(s.id) FROM {local_treestudyplan} s $sql = "SELECT COUNT(s.id) FROM {local_treestudyplan} s
INNER JOIN {local_treestudyplan_cohort} j ON j.studyplan_id = s.id INNER JOIN {local_treestudyplan_cohort} j ON j.studyplan_id = s.id
INNER JOIN {cohort_members} cm ON j.cohort_id = cm.cohortid INNER JOIN {cohort_members} cm ON j.cohort_id = cm.cohortid
INNER JOIN {user} u ON cm.userid = user.id INNER JOIN {user} u ON cm.userid = u.id
WHERE cm.userid = :userid AND u.deleted != 1"; WHERE cm.userid = :userid AND u.deleted != 1";
$count += $DB->count_records_sql($sql, ['userid' => $userid]); $count += $DB->count_records_sql($sql, ['userid' => $userid]);
@ -759,7 +759,7 @@ class studyplan {
// Next het users linked though cohort. // Next het users linked though cohort.
$sql = "SELECT cm.userid FROM {local_treestudyplan_cohort} j $sql = "SELECT cm.userid FROM {local_treestudyplan_cohort} j
INNER JOIN {cohort_members} cm ON j.cohort_id = cm.cohortid INNER JOIN {cohort_members} cm ON j.cohort_id = cm.cohortid
INNER JOIN {user} u ON cm.userid = user.id INNER JOIN {user} u ON cm.userid = u.id
WHERE j.studyplan_id = :planid AND u.deleted != 1"; WHERE j.studyplan_id = :planid AND u.deleted != 1";
$ulist = $DB->get_fieldset_sql($sql, ['planid' => $this->id]); $ulist = $DB->get_fieldset_sql($sql, ['planid' => $this->id]);