Commit 6700d301 authored by xianyang's avatar xianyang

优化3

parent e825808a
......@@ -359,14 +359,14 @@ class AccountStatistics(object):
if self.user_list:
user_uuid = self.user_list[0]
condition.append(f" uuid='{user_uuid.get('uuid')}'")
u_sql = f"select uuid,type,reference_type,SUM(cast(amount as decimal(20,6)))/1000 as amount,create_time,amount_type from {date} WHERE {' and '.join(condition)} GROUP BY uuid,type,reference_type,amount_type ORDER BY create_time DESC"
u_sql = f"select uuid,type,reference_type,SUM(cast(amount as decimal(20,6)))/1000 as amount,reference_number,create_time,amount_type from {date} WHERE {' and '.join(condition)} GROUP BY uuid,type,reference_type,amount_type ORDER BY create_time DESC"
else:
if self.uuid:
condition.append(f" uuid='{self.uuid}'")
if condition:
u_sql = f"select id,uuid,order_number,type,reference_type,amount/1000 as amount,create_time from {date} WHERE {' and '.join(condition)} ORDER BY create_time DESC"
u_sql = f"select id,uuid,order_number,type,reference_type,amount/1000 as amount,reference_number,create_time from {date} WHERE {' and '.join(condition)} ORDER BY create_time DESC"
else:
u_sql = f"select id,uuid,order_number,type,reference_type,amount/1000 as amount,create_time from {date} ORDER BY create_time DESC"
u_sql = f"select id,uuid,order_number,type,reference_type,amount/1000 as amount,reference_number,create_time from {date} ORDER BY create_time DESC"
result = LinkMysql(env.DB_HISTORY).query_mysql(u_sql)
return result
......
......@@ -113,10 +113,7 @@ def search(params, method):
if response.status_code != 200:
return {}
text = json.loads(response.text)
if text.get("data").get("result").get("msg")=='success':
return True
else:
return False
return text
def get_ip():
......
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