Commit 10efc07b by Aeolus

update

parent 5188d3df
......@@ -557,25 +557,19 @@ def run_draw_list():
select_sql = """
select draw_record.draw_no,
draw_record.business_id,
draw_record.bill_date,
draw_record.total,
draw_record.real_total,
draw_record.rate,
draw_record.status,
draw_record.draw_time,
draw_record.created_at,
draw_record.updated_at,
draw_record.id,
business.business_name
draw_record.id
"""
count_sql = " select count(draw_record.id) as total_count "
from_sql = """
FROM
draw_record
LEFT JOIN
business ON draw_record.business_id = business.id
"""
where_sql = " WHERE draw_record.status <> '-1' "
......@@ -591,11 +585,6 @@ def run_draw_list():
if business_id is not None:
where_sql += " and draw_record.business_id = '{}'".format(business_id)
if g.user.level != 1:
where_sql += """ and draw_record.business_id in (
select business_id from admin_business where user_id = '{}' and status = 1)
""".format(g.user.id)
order_sql = " ORDER BY draw_record.created_at DESC, draw_record.status asc"
limit_sql = " LIMIT {offset} , {page_size}".format(offset=(page - 1) * page_size, page_size=page_size)
......@@ -612,9 +601,9 @@ def run_draw_list():
if result:
for info in result:
tmp = {
"business_id": info.business_id, "bill_date": info.bill_date, "total": info.total,
"real_total": info.real_total, "rate": info.rate, "status": info.status,
"business_name": info.business_name, "id": info.id,
"bill_date": info.bill_date,
"real_total": info.real_total, "status": info.status,
"id": info.id,
"create_time": info.created_at.strftime("%Y-%m-%d %H:%M:%S"),
"draw_time": info.draw_time.strftime("%Y-%m-%d %H:%M:%S") if info.draw_time 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