From 1e5de7b488f110c30ba34e6d8398309fc6aea986 Mon Sep 17 00:00:00 2001 From: "apan_youxiang@163.com" Date: Tue, 16 Aug 2022 09:48:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=A1=A8=E5=8D=95=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/drug_form/views.py | 7 +++++++ db_logic/medicament_extend.py | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/drug_form/views.py b/apps/drug_form/views.py index b87caa7..2e476c8 100644 --- a/apps/drug_form/views.py +++ b/apps/drug_form/views.py @@ -79,3 +79,10 @@ def del_drug_form(): return jsonify(Utils.true_return(msg="删除成功")) else: return jsonify(Utils.false_return(msg="该表单不存在")) + + +@drug_form_router.route("/get_use", methods=["GET"]) +# @token_auth.login_required +def get_use_drug_form(): + data_list = BllMedicamentExtend().get_use_list() + return jsonify(Utils.true_return(data=Utils.msyql_table_model(data_list))) diff --git a/db_logic/medicament_extend.py b/db_logic/medicament_extend.py index 121bc67..d87dd8e 100644 --- a/db_logic/medicament_extend.py +++ b/db_logic/medicament_extend.py @@ -30,4 +30,10 @@ class BllMedicamentExtend(Repository): page_param.totalRecords=count_number page_sql = Utils.sql_paging_assemble(sql_all, page_param) - return self.execute(page_sql) \ No newline at end of file + return self.execute(page_sql).fetchall() + + def get_use_list(self): + sql_all = """ + select id, name, description,key_lenth, sort_index, is_use from rms_medicament_extend where is_del=0 and is_use=1 order by sort_index + """ + return self.execute(sql_all).fetchall() \ No newline at end of file