Commit dc28ee88 authored by xupeng's avatar xupeng

过滤查询修改

parent 0aec42a8
......@@ -267,7 +267,7 @@ class WithdrawStatement(object):
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 = 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)
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 \
......
......@@ -268,7 +268,6 @@ def query_token(db, h_list):
def transfer_trigger_task(uuid, user_id, balance, type, amount_type, remark='用户转账', money_data=[],
isUser=1, dst_uuid="", referNum=''):
"""转账验证"""
request_data = {
"ip": get_ip(),
"uuid": uuid,
......@@ -501,25 +500,29 @@ def transfer_query(data):
platform=LinkMysql(env.DB_3YV2).perform_mysql(payment_sql)
params = {}
referNum=f'platomOutMoney_{platform}'
referType='Payment'
amount_type='consumable'
reference_type='finance_admin_fix'
uuid =data.uuid
ip=get_ip()
money=data.money * -1 if data.money < 0 else data.money
if money > 0:
params['referNum'] = referNum
params['referType'] = referType
params['amount_type']=amount_type
params['uuid'] = uuid
params['ip'] = ip
params['money'] = money
else:
params['referNum'] = referNum
params['referType'] = referType
params['dst_amount_type'] = 'consumable'
params['amount'] = money
params['fee']=0
params['reference_info']=[]
params['reference_number']=referNum
params['reference_type']=reference_type
params['dst_uuid'] = uuid
params['money'] = money
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
......
......@@ -113,6 +113,7 @@ def search(params, method):
if response.status_code != 200:
return {}
text = json.loads(response.text)
print(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