Commit 8d619eda authored by xupeng's avatar xupeng

金额回显错误

parent c21d8011
...@@ -289,7 +289,7 @@ class WithdrawStatement(object): ...@@ -289,7 +289,7 @@ class WithdrawStatement(object):
else: else:
count_sql = "SELECT sum(a.b) FROM ("f"SELECT count(*) as b FROM assets_log_{int(now_month[0])} where {(' and '.join(query))} UNION ALL SELECT count(*) FROM assets_log_{int(now_month[1])} where {(' and '.join(query))}) AS a " count_sql = "SELECT sum(a.b) FROM ("f"SELECT count(*) as b FROM assets_log_{int(now_month[0])} where {(' and '.join(query))} UNION ALL SELECT count(*) FROM assets_log_{int(now_month[1])} where {(' and '.join(query))}) AS a "
count = self.linkmysql.query_mysql(count_sql)[0].get("sum(a.b)") count = self.linkmysql.query_mysql(count_sql)[0].get("sum(a.b)")
sql = f"SELECT id,uuid,(amount/1000) as amount ,amount_type, FROM_UNIXTIME(create_time) as payment_time,reference_type,reference_number FROM assets_log_{int(now_month[0])} where {(' and '.join(query))} UNION ALL SELECT id,uuid,amount,amount_type, FROM_UNIXTIME(create_time) as payment_time,reference_type,reference_number FROM assets_log_{int(now_month[1])} where {(' and '.join(query))} ORDER BY id desc limit {(int(page) - 1) * size},{size}" sql = f"SELECT id,uuid,(amount/1000) as amount ,amount_type, FROM_UNIXTIME(create_time) as payment_time,reference_type,reference_number FROM assets_log_{int(now_month[0])} where {(' and '.join(query))} UNION ALL SELECT id,uuid,(amount/1000) as amount,amount_type, FROM_UNIXTIME(create_time) as payment_time,reference_type,reference_number FROM assets_log_{int(now_month[1])} where {(' and '.join(query))} ORDER BY id 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))} UNION ALL SELECT sum(amount)FROM assets_log_{int(now_month[1])} where {(' and '.join(query))} ) 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))} UNION ALL SELECT sum(amount)FROM assets_log_{int(now_month[1])} where {(' and '.join(query))} ) 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,reality_moeny return count, once_res, moeny_data/1000,reality_moeny/1000
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):
"""公会提现""" """公会提现"""
...@@ -342,7 +342,7 @@ class WithdrawStatement(object): ...@@ -342,7 +342,7 @@ class WithdrawStatement(object):
query_data = self.query_add_time(query,start_time, end_time) query_data = self.query_add_time(query,start_time, end_time)
now_month = get_month_last_month(month_type,start_time,end_time) now_month = get_month_last_month(month_type,start_time,end_time)
count, once_res, moeny_data,reality_moeny = self.dispose_user(month_type, query_data, page, size, now_month) count, once_res, moeny_data,reality_moeny = self.dispose_user(month_type, query_data, page, size, now_month)
return count, once_res, moeny_data,reality_moeny return count, once_res, moeny_data/1000,reality_moeny/1000
class FinanceFix(object): class FinanceFix(object):
......
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