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