2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Updated appointment ordering in scheduler to handle NULLS

This commit is contained in:
Adam Zammit
2013-06-13 11:25:35 +10:00
parent 98df307ae3
commit 8d2a754042
2 changed files with 2 additions and 2 deletions

View File

@@ -148,7 +148,7 @@ while (!is_process_killed($process_id)) //check if process killed every $sleepin
AND ((apn.appointment_id IS NOT NULL) or qs.call_max = 0 or ((SELECT count(*) FROM `call` WHERE case_id = c.case_id) < qs.call_max))
AND (SELECT count(*) FROM `questionnaire_sample_quota` WHERE questionnaire_id = c.questionnaire_id AND sample_import_id = s.import_id AND quota_reached = 1) = 0
GROUP BY c.case_id
ORDER BY apn.end ASC, a.start ASC, qsep.priority DESC";
ORDER BY IF(ISNULL(apn.end),1,0),apn.end ASC, a.start ASC, qsep.priority DESC";
$rs = $db->GetAll($sql);