Commit 77fefe70 authored by xianyang's avatar xianyang

优化质押金账户bug

parent 303e8072
......@@ -574,7 +574,7 @@ class AccountStatistics(object):
end_time = time_str_to_timestamp(self.end_time + ' 23:59:59')
month_tuple = get_date_list(self.start_time, self.end_time)
cp_cond.append(f" create_time >={start_time} and create_time<= {end_time}")
cp_cond.append(" (income != 0 or outcome !=0 or initial_money !=0) ")
cp_cond.append(" (income != 0 or outcome !=0 or initial_money !=0) and amount_type=1")
if self.user_id:
guild_sql = f"select ice_uuid from guild where id={self.user_id}"
res_data = LinkMysql(env.DB_3YV2).query_mysql(guild_sql)
......@@ -586,7 +586,7 @@ class AccountStatistics(object):
year, month = str(i)[:4], str(i)[4:]
table = 'finance_data_calculation_pledge' + year + '_' + month
try:
cp_sql = f"SELECT FROM_UNIXTIME(create_time, '%Y-%c-%d') as create_time,uuid,income,outcome,initial_money from {table} WHERE {' and '.join(cp_cond)} GROUP BY create_time, uuid ORDER BY create_time DESC"
cp_sql = f"SELECT FROM_UNIXTIME(create_time, '%Y-%c-%d') as create_time,uuid,income,outcome,initial_money from {table} WHERE {' and '.join(cp_cond)} ORDER BY create_time DESC"
mysql_data = LinkMysql(env.DB_3YV2).query_mysql(cp_sql)
result_list = result_list + mysql_data
except Exception as e:
......
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