|
|
@@ -140,8 +140,8 @@ $location_ids_csv = implode(", ", $location_ids);
|
|
|
|
|
|
$sql = "SELECT `location`.*, COUNT(`test`.`id`) AS `test_count`, SUM(IF(`test`.`retest` = 1, 1, 0)) AS `retest_count`
|
|
|
FROM `location`
|
|
|
- LEFT JOIN `test` ON `test`.`location_id`=`location`.`id` AND `dts_start` BETWEEN '$date_start' AND '$date_end'
|
|
|
- WHERE `location`.`id` IN ($location_ids_csv) AND (`test`.`status`='" . Test::STATUS_COMPLETED . "' OR `test`.`status` IS NULL) GROUP BY `location`.`id`
|
|
|
+ LEFT JOIN `test` ON `test`.`location_id`=`location`.`id` AND `dts_start` BETWEEN '$date_start' AND '$date_end' AND `test`.`status`='" . Test::STATUS_COMPLETED . "'
|
|
|
+ WHERE `location`.`id` IN ($location_ids_csv) GROUP BY `location`.`id`
|
|
|
ORDER BY $query_sort $order
|
|
|
";
|
|
|
|