Commit dc28ee88 authored by xupeng's avatar xupeng

过滤查询修改

parent 0aec42a8
...@@ -267,7 +267,7 @@ class WithdrawStatement(object): ...@@ -267,7 +267,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,amount_type, FROM_UNIXTIME(create_time,'%Y-%c-%d %h:%i:%s') as payment_time,reference_type,reference_number FROM assets_log_{int(now_month[0])} where {(' and '.join(query))} UNION ALL SELECT id,uuid,amount,FROM_UNIXTIME(create_time,'%Y-%c-%d %h:%i:%s') as payment_time,reference_type,reference_number,amount_type 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,amount_type, FROM_UNIXTIME(create_time,'%Y-%c-%d %h:%i:%s') 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,'%Y-%c-%d %h:%i:%s') 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 \
......
...@@ -268,7 +268,6 @@ def query_token(db, h_list): ...@@ -268,7 +268,6 @@ def query_token(db, h_list):
def transfer_trigger_task(uuid, user_id, balance, type, amount_type, remark='用户转账', money_data=[], def transfer_trigger_task(uuid, user_id, balance, type, amount_type, remark='用户转账', money_data=[],
isUser=1, dst_uuid="", referNum=''): isUser=1, dst_uuid="", referNum=''):
"""转账验证""" """转账验证"""
request_data = { request_data = {
"ip": get_ip(), "ip": get_ip(),
"uuid": uuid, "uuid": uuid,
...@@ -501,25 +500,29 @@ def transfer_query(data): ...@@ -501,25 +500,29 @@ def transfer_query(data):
platform=LinkMysql(env.DB_3YV2).perform_mysql(payment_sql) platform=LinkMysql(env.DB_3YV2).perform_mysql(payment_sql)
params = {} params = {}
referNum=f'platomOutMoney_{platform}' referNum=f'platomOutMoney_{platform}'
referType='Payment' reference_type='finance_admin_fix'
amount_type='consumable'
uuid =data.uuid uuid =data.uuid
ip=get_ip() ip=get_ip()
money=data.money * -1 if data.money < 0 else data.money money=data.money * -1 if data.money < 0 else data.money
if money > 0: if money > 0:
params['referNum'] = referNum params['dst_amount_type'] = 'consumable'
params['referType'] = referType params['amount'] = money
params['amount_type']=amount_type params['fee']=0
params['uuid'] = uuid params['reference_info']=[]
params['ip'] = ip params['reference_number']=referNum
params['money'] = money params['reference_type']=reference_type
else:
params['referNum'] = referNum
params['referType'] = referType
params['dst_uuid'] = uuid params['dst_uuid'] = uuid
params['money'] = money
params['ip'] = ip params['ip'] = ip
search(params=params, method='Server.BaseExecute.Increase') params['timestamp'] = get_now_timestamp()
else:
pass
# params['referNum'] = referNum
# params['referType'] = referType
# params['dst_uuid'] = uuid
# params['money'] = money
# params['ip'] = ip
print(params)
search(params=params, method='Server.BaseExecute.Reduce')
return return
......
...@@ -113,6 +113,7 @@ def search(params, method): ...@@ -113,6 +113,7 @@ def search(params, method):
if response.status_code != 200: if response.status_code != 200:
return {} return {}
text = json.loads(response.text) text = json.loads(response.text)
print(text)
return text return text
......
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