简化分页取count

This commit is contained in:
xz
2021-09-23 09:57:13 +08:00
parent 9114964ef2
commit 23dbe9ee9c
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ def table():
# orm查询
# 使用分页获取data需要.items
role = Role.query.filter(mf.get_filter(Role)).layui_paginate()
count = Role.query.filter(mf.get_filter(Role)).count()
count = role.total
# 返回api
return table_api(data=model_to_dicts(schema=RoleSchema, data=role.items), count=count)