Selaa lähdekoodia

Fix location query

Alan Lam 6 kuukautta sitten
vanhempi
commit
f14e0f3500
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      controllers/locations.php

+ 2 - 2
controllers/locations.php

@@ -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
 ";