Commit e8acd66b by dong

fix20230201

parent a29ebf56
...@@ -26,7 +26,8 @@ def get_all_enterprise(): ...@@ -26,7 +26,8 @@ def get_all_enterprise():
return jsonify(code=RET.PARAMERR, msg="参数不完整") return jsonify(code=RET.PARAMERR, msg="参数不完整")
try: try:
enterprise_all_counts = len(Enterprise.query.all()) # enterprise_all_counts = len(Enterprise.query.all())
enterprise_all_counts = Enterprise.query.count()
# print(enterprise_all_counts) # print(enterprise_all_counts)
enterprise_list = Enterprise.query.paginate(page, perpage).items enterprise_list = Enterprise.query.paginate(page, perpage).items
# counts = len(enterprise_list) # counts = len(enterprise_list)
...@@ -34,7 +35,8 @@ def get_all_enterprise(): ...@@ -34,7 +35,8 @@ def get_all_enterprise():
if enterprise_list: if enterprise_list:
data = {"data": [{"id": enterprise.id, data = {"data": [{"id": enterprise.id,
"company": enterprise.company_name, # 企业名 "company": enterprise.company_name, # 企业名
"area": enterprise.city + enterprise.district, # "area": enterprise.city + enterprise.district,
"area": '',
"createtime": (enterprise.build_date).strftime("%Y-%m-%d") if enterprise.build_date else '', "createtime": (enterprise.build_date).strftime("%Y-%m-%d") if enterprise.build_date else '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment