mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Remove unused columns from get_case_id select statement
Make sure to make cases and sample records unavailable before sorting enabled ones
This commit is contained in:
@@ -98,6 +98,14 @@ while (!is_process_killed($process_id)) //check if process killed every $sleepin
|
||||
|
||||
$db->StartTrans();
|
||||
|
||||
//First set all cases as unavailable
|
||||
$sql = "UPDATE `case`
|
||||
SET sortorder = NULL
|
||||
WHERE 1";
|
||||
|
||||
$db->Execute($sql);
|
||||
|
||||
|
||||
//Sort current cases for all enabled questionnaires
|
||||
|
||||
|
||||
@@ -136,6 +144,16 @@ while (!is_process_killed($process_id)) //check if process killed every $sleepin
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
//First set all sample records as unavailable
|
||||
$sql = "UPDATE `questionnaire_sample_exclude_priority`
|
||||
SET sortorder = NULL
|
||||
WHERE 1";
|
||||
|
||||
$db->Execute($sql);
|
||||
|
||||
|
||||
|
||||
//Sort sample list where attached to an enabled questionnaire
|
||||
|
||||
$sql = "SELECT s.sample_id as sample_id,qs.questionnaire_id as questionnaire_id
|
||||
|
||||
@@ -334,7 +334,7 @@ function get_case_id($operator_id, $create = false)
|
||||
* @todo also could check the respondent_not_available table to see if now is a "bad time" to call
|
||||
*/
|
||||
|
||||
$sql = "SELECT c.case_id as caseid,s.*,apn.*,a.*,sh.*,op.*,cr.*,si.*,CONVERT_TZ(NOW(), 'System' , s.Time_zone_name) as resptime
|
||||
$sql = "SELECT c.case_id as caseid
|
||||
FROM `case` as c
|
||||
LEFT JOIN `call` as a on (a.call_id = c.last_call_id)
|
||||
JOIN (sample as s, sample_import as si) on (s.sample_id = c.sample_id and si.sample_import_id = s.import_id)
|
||||
|
||||
Reference in New Issue
Block a user