From 16ef04ef80b2fc6018e25d650f015f6a685ed665 Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 7 Sep 2023 18:56:23 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9menu?= =?UTF-8?q?=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Controllers/DeviceManageController.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Backend/Controllers/DeviceManageController.cs b/Backend/Controllers/DeviceManageController.cs index 40e97d2..75f31b9 100644 --- a/Backend/Controllers/DeviceManageController.cs +++ b/Backend/Controllers/DeviceManageController.cs @@ -56,15 +56,16 @@ namespace Backend.Controllers FROM building_menu bm JOIN building b ON bm.building_tag = b.building_tag AND b.deleted = 0 JOIN variable mv ON bm.main_system_tag = mv.system_value AND mv.deleted = 0 and mv.system_type = '{main_system_type}' - JOIN variable sv ON bm.sub_system_tag = sv.system_value AND sv.deleted = 0 and sv.system_type = '{sub_system_type}'"; + JOIN variable sv ON bm.sub_system_tag = sv.system_value AND sv.deleted = 0 and sv.system_type = '{sub_system_type}' + where bm.is_link = 1 "; if (!string.IsNullOrEmpty(filter)) { - sql += $@" WHERE ( + sql += $@" and ( b.full_name LIKE CONCAT('%', @Filter, '%') OR mv.system_key LIKE CONCAT('%', @Filter, '%') OR sv.system_key LIKE CONCAT('%', @Filter, '%') - )"; + ) "; } sql += $@" ORDER BY b.priority, mv.system_priority, bm.priority, sv.system_priority, sv.created_at DESC"; @@ -109,6 +110,17 @@ namespace Backend.Controllers foreach (var buildingMenus_Sub_system_tag in buildingMenus_Group_Sub_system_tag) { + if (main_System.Main_system_tag == "S") + { + string name = buildingMenus_Sub_system_tag.First().sFull_name; + if (name == "人流計數") + { + bool check = buildingMenus_Sub_system_tag.Key.StartsWith(buildingMenus_Building_tag.Key[0]); + + if (!check) + continue; //跳回圈 + } + } Sub_system sub_System = new Sub_system(); sub_System.Sub_system_tag = buildingMenus_Sub_system_tag.Key; sub_System.Full_name = buildingMenus_Sub_system_tag.First().sFull_name;