修改模板分页数据问题

duizhaopin
apan 2 years ago
parent 78c79230e3
commit 2a51b4bae8

@ -22,14 +22,17 @@ class BllMedicamentTemplate(Repository):
# 获取所有模板列表
def getAllTemplateList(self, client_id, page_param):
sql_all = "select %s from rms_medicament_template where is_wait_export=1 "
sql_all = "select * from rms_medicament_template where is_wait_export=1 "
end_sql = "order by create_date desc"
if client_id:
sql_all = sql_all + f"and client_id='{client_id}'"
page_param.totalRecords = self.execute(sql_all% ("count(*)")).fetchone()[0]
sql_all = Utils.sql_paging_assemble(sql_all % "*" + end_sql, page_param)
data = self.execute(sql_all % "*").fetchall()
try:
count_number = len(self.execute(sql_all).fetchall())
except Exception:
count_number = 0
page_param.totalRecords = count_number
sql_all = Utils.sql_paging_assemble(sql_all + end_sql, page_param)
data = self.execute(sql_all).fetchall()
return data
# 批量或删除单个模板

@ -23,13 +23,11 @@ class BllUser(Repository):
#用户账号密码登录
def login(self, user_name, password):
user_info = self.findEntity(EntityUser.account == user_name)
if user_info.is_enabled:
if user_info.check_password(password):
return self.get_jwt(user_info)
else:
return False
else:
return False
if user_info:
if user_info.is_enabled:
if user_info.check_password(password):
return self.get_jwt(user_info)
return False
def get_jwt(self, obj, expires_in=36000):
'''用户登录后,发放有效的 JWT'''

Loading…
Cancel
Save