From bafcd72481bf64e7a94db98d02a0a8b7092af4d6 Mon Sep 17 00:00:00 2001 From: 13507605001 Date: Sat, 31 Dec 2022 12:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/drug/views.py | 2 +- db_logic/medicament.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/drug/views.py b/apps/drug/views.py index e8c415a..d3a4c0c 100644 --- a/apps/drug/views.py +++ b/apps/drug/views.py @@ -144,7 +144,7 @@ def drug_use_retur_list(): page = int(request.values.get("page", 1)) page_size = int(request.values.get("page_size", 10)) page_param = PageParam(page, page_size) - data = BllMedicament().drug_use_return(status=status, func_type=func_type, page_param=page_param) + data = BllMedicament().drug_use_return(status=status, func_type=func_type, user=g.current_user, page_param=page_param) return jsonify(Utils.true_return(data={"total_count": page_param.totalRecords, "data": Utils.msyql_table_model(data)})) diff --git a/db_logic/medicament.py b/db_logic/medicament.py index 7d96e19..838f614 100644 --- a/db_logic/medicament.py +++ b/db_logic/medicament.py @@ -375,9 +375,9 @@ class BllMedicament(Repository): self.commitTrans() # 获取领用和归还页面列表 - def drug_use_return(self, status, func_type, page_param): + def drug_use_return(self, status, func_type, user, page_param): sql_all = f""" - select * from rms_medicament where status={status} and func_type='{func_type}' and status != 3 order by by_user_date desc + select * from rms_medicament where status={status} and func_type='{func_type}' and by_user_id='{user.user_id}' order by by_user_date desc """ try: count_number = len(self.execute(sql_all).fetchall())