Commit 3d3d292f by Aeolus

update

parent d76703a9
...@@ -289,6 +289,6 @@ def run_edit_admin_account(): ...@@ -289,6 +289,6 @@ def run_edit_admin_account():
admin_business.rate = rate admin_business.rate = rate
admin_business.status = 1 admin_business.status = 1
db.session.add(admin_business) db.session.add(admin_business)
db.session.commit()
db.session.commit()
return BaseResponse() return BaseResponse()
...@@ -65,7 +65,7 @@ class AdminService(object): ...@@ -65,7 +65,7 @@ class AdminService(object):
admin_account.comment,admin_account.parent_id, admin_account.created_at, admin_account.comment,admin_account.parent_id, admin_account.created_at,
admin_account.updated_at,admin_account.id, admin_account.user_no admin_account.updated_at,admin_account.id, admin_account.user_no
""" """
count_sql = "select count(admin_account.id) as total_count" count_sql = "select count(1) as total_count"
from_sql = " from admin_account " from_sql = " from admin_account "
if g.user.level == 1: if g.user.level == 1:
...@@ -75,10 +75,10 @@ class AdminService(object): ...@@ -75,10 +75,10 @@ class AdminService(object):
where where
admin_account.id in ( admin_account.id in (
select user_id from admin_business where business_id in ( select user_id from admin_business where business_id in (
select business_id from admin_business where user_id = {user_id} and status = 1 select business_id from admin_business where user_id = '{user_id}' and status = '1'
) )
) )
and admin_account.level >= {level} and admin_account.level >= '{level}'
""".format(user_id=g.user.id, level=g.user.level) """.format(user_id=g.user.id, level=g.user.level)
if user_id: if user_id:
...@@ -104,7 +104,6 @@ class AdminService(object): ...@@ -104,7 +104,6 @@ class AdminService(object):
return {"list": [], "page": page, "pageSize": page_size, "total_count": 0} return {"list": [], "page": page, "pageSize": page_size, "total_count": 0}
else: else:
total_count = count_result.total_count total_count = count_result.total_count
result = db.session.execute(select_sql + from_sql + where_sql + order_sql + limit_sql).fetchall() result = db.session.execute(select_sql + from_sql + where_sql + order_sql + limit_sql).fetchall()
return_data = [] return_data = []
......
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