From 52ae9aa30ec2804d1143c520572a4faeced27a30 Mon Sep 17 00:00:00 2001 From: Didier Date: Wed, 13 Sep 2023 14:49:06 +0200 Subject: [PATCH] report on active domains only --- app/Http/Controllers/ControlController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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')