Commit cb4bb128 authored by xupeng's avatar xupeng

导出报错

parent 66e31513
...@@ -140,7 +140,7 @@ class RechargeStatement(object): ...@@ -140,7 +140,7 @@ class RechargeStatement(object):
if export_status: if export_status:
query1 = (' and '.join(query[0])) query1 = (' and '.join(query[0]))
query2 = (' and '.join(query[1])) query2 = (' and '.join(query[1]))
sql = f"SELECT id,uuid,(amount/1000) as amount as amount,FROM_UNIXTIME(create_time) as payment_time,reference_type,reference_number FROM assets_log_{int(now_month[0])} where {query1} UNION ALL SELECT id,uuid,amount/1000 as amount,FROM_UNIXTIME(create_time) as payment_time,reference_type,reference_number FROM assets_log_{int(now_month[1])} where {query2} ORDER BY payment_time" sql = f"SELECT id,uuid,(amount/1000) as amount,FROM_UNIXTIME(create_time) as payment_time,reference_type,reference_number FROM assets_log_{int(now_month[0])} where {query1} UNION ALL SELECT id,uuid,amount/1000 as amount,FROM_UNIXTIME(create_time) as payment_time,reference_type,reference_number FROM assets_log_{int(now_month[1])} where {query2} ORDER BY payment_time"
once_res = self.linkmysql.query_mysql(sql) once_res = self.linkmysql.query_mysql(sql)
count = 0 count = 0
moeny_data = 1000 moeny_data = 1000
......
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