Commit 66e31513 authored by xupeng's avatar xupeng

金额回显错误

parent 472f1d72
...@@ -149,7 +149,7 @@ class RechargeStatement(object): ...@@ -149,7 +149,7 @@ class RechargeStatement(object):
count = self.linkmysql.query_mysql(count_sql)[0].get("sum(a.b)") count = self.linkmysql.query_mysql(count_sql)[0].get("sum(a.b)")
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 desc limit {(int(page) - 1) * size},{size}" 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 desc limit {(int(page) - 1) * size},{size}"
once_res = self.linkmysql.query_mysql(sql) once_res = self.linkmysql.query_mysql(sql)
money_sql = f"SELECT sum(a.b) FROM ("f"SELECT sum(amount) as b FROM assets_log_{int(now_month[0])} where {(' and '.join(query[0]))} UNION ALL SELECT sum(amount)FROM assets_log_{int(now_month[1])} where {(' and '.join(query[1]))}) AS a " money_sql = f"SELECT sum(a.b) FROM ("f"SELECT sum(amount) as b FROM assets_log_{int(now_month[0])} where {(' and '.join(query[0]))} UNION ALL SELECT sum(amount)FROM assets_log_{int(now_month[1])} where {(' and '.join(query[1]))}) AS a "
moeny_data = self.linkmysql.query_mysql(money_sql)[0].get("sum(a.b)") if \ moeny_data = self.linkmysql.query_mysql(money_sql)[0].get("sum(a.b)") if \
...@@ -299,7 +299,7 @@ class WithdrawStatement(object): ...@@ -299,7 +299,7 @@ class WithdrawStatement(object):
moeny_income = self.linkmysql.query_mysql(income_sql)[0].get("sum(a.b)") if \ moeny_income = self.linkmysql.query_mysql(income_sql)[0].get("sum(a.b)") if \
self.linkmysql.query_mysql(income_sql)[0].get("sum(a.b)") != None else 0 self.linkmysql.query_mysql(income_sql)[0].get("sum(a.b)") != None else 0
reality_moeny=moeny_data-abs(moeny_income) reality_moeny=moeny_data-abs(moeny_income)
return count, once_res, moeny_data/1000,reality_moeny/1000 return count, once_res, moeny_data,reality_moeny
def get_guild_withdraw_cash(self, db, page, size, name, status, start_time, end_time, month_type, menu_id): def get_guild_withdraw_cash(self, db, page, size, name, status, start_time, end_time, month_type, menu_id):
"""公会提现""" """公会提现"""
......
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