Alan Lam 8 лет назад
Родитель
Сommit
63dc996e84
1 измененных файлов с 5 добавлено и 6 удалено
  1. 5 6
      controllers/performance.php

+ 5 - 6
controllers/performance.php

@@ -22,6 +22,8 @@ $date_resolution = http::value("date_resolution");
 $from_quarter = http::value("from_quarter");
 $to_quarter = http::value("to_quarter");
 
+$project_ids = http::value("project_ids", "int");
+
 $all_projects = Project::query([
 	"customer_id" => $customer->id
 ]);
@@ -58,8 +60,6 @@ $colours = [
 	"#9e9e9e",
 ];
 
-$project_ids = [];
-
 $submit = http::value("submit");
 if($submit) {
 	try {
@@ -68,14 +68,12 @@ if($submit) {
 		$form_exception = new FormException;
 		if($form_exception->hasErrors()) throw $form_exception;
 
-
 		// Get all tests
 		$projects = Project::query([
-			"customer_id" => $customer->id
+			"customer_id" => $customer->id,
+			"id" => $project_ids
 		]);
 
-		$project_ids = array_column($projects, "id");
-
 		$tests = Test::query([
 			"project_id" => $project_ids,
 			"status" => Test::STATUS_COMPLETED
@@ -84,6 +82,7 @@ if($submit) {
 		User::load(array_column($tests, "tester_id"));
 		$locations = Location::load(array_column($tests, "location_id"));
 
+
 		$regions = array_filter(array_column($locations, "region"));
 		$area_managers = array_filter(array_column($locations, "area_manager"));