Fixed cast for postgres

This commit is contained in:
PMKuipers 2024-12-31 16:47:05 +01:00
parent 3a478d3960
commit 35a0577d7d

View file

@ -818,7 +818,7 @@ class badgeinfo {
$sql = "SELECT DISTINCT b.id from {badge} b
INNER JOIN {badge_criteria} crit ON b.id = crit.badgeid
INNER JOIN {badge_criteria_param} p on p.critid = crit.id
INNER JOIN {competency_coursecomp} cc on cc.competencyid = CAST(COALESCE(p.value, 0) as INTEGER)
INNER JOIN {competency_coursecomp} cc on cc.competencyid = CAST(p.value as INTEGER)
WHERE cc.courseid = :courseid AND crit.criteriatype $ctypesql $conditions";
$competencyrelids = $DB->get_fieldset_sql($sql, $sqlparams);