diff --git a/app/Http/Controllers/ControlController.php b/app/Http/Controllers/ControlController.php index ad9da98d..487941bf 100644 --- a/app/Http/Controllers/ControlController.php +++ b/app/Http/Controllers/ControlController.php @@ -376,6 +376,7 @@ public function domains(Request $request) ->select(DB::raw('distinct domains.id, domains.title')) ->join('controls', 'domains.id', '=', 'controls.domain_id') ->whereNull("realisation_date") + ->orderBy("domains.title") ->get(); // get all scopes @@ -443,8 +444,13 @@ public function domains(Request $request) public function measures(Request $request) { - // Get all domains - $domains = Domain::All(); + // get all active domains + $domains = DB::table('domains') + ->select(DB::raw('distinct domains.id, domains.title, domains.description')) + ->join('controls', 'domains.id', '=', 'controls.domain_id') + ->whereNull("realisation_date") + ->orderBy("domains.title") + ->get(); // get all scopes $scopes = DB::table('controls')