From e2bc5b5cdbafcca067bb70767a707c98c9706681 Mon Sep 17 00:00:00 2001 From: apan Date: Fri, 5 Aug 2022 15:31:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=83=E9=99=90=E5=88=86?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db_logic/module.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/db_logic/module.py b/db_logic/module.py index 8d9ef17..9538b01 100644 --- a/db_logic/module.py +++ b/db_logic/module.py @@ -20,19 +20,27 @@ class BllModule(Repository): select module_id, module_type, module_name, sort_index, description from rms_module where is_enabled=1 """ data = { - "sys_list":[], - "client_list":[] + + # "client_list":[] + "client_manage": [], + "sys_manage": [], + "standard_manage": [], + "consumables_manage": [], + "instrument_manage": [] } sql_data = Utils.msyql_table_model(self.execute(sql_all).fetchall()) for i in sql_data: if i["module_type"] == "1": - data["client_list"].append(i) - else: - data["sys_list"].append(i) - data["sys_list"].sort(key=lambda x: x['sort_index']) - data["client_list"].sort(key=lambda x: x['sort_index']) + data["client_manage"].append(i) + elif i["module_type"] == "2": + data["sys_manage"].append(i) + elif i["module_type"] == "3": + data["standard_manage"].append(i) + elif i["module_type"] == "4": + data["consumables_manage"].append(i) + elif i["module_type"] == "5": + data["instrument_manage"].append(i) return data - # return self.findList().all() def inster_info_list(self): obj_list = [] @@ -49,9 +57,6 @@ class BllModule(Repository): create_date=Utils.get_str_datetime(), create_user_id='4cea74ee-0d8b-11ed-943e-f47b094925e1', create_user_name="admin", - - - ) obj_list.append(obj) self.insert_many(obj_list)