Commit 8d3031d3 authored by xianyang's avatar xianyang

优化业务类型汇总

parent 990b28b3
......@@ -249,7 +249,7 @@ class ReferenceTypeClassification():
def classification_summary(self):
data_sql = f"select uuid,type,sum(amount) as amount,create_time from {self.date} where reference_type='{self.reference_type}' GROUP BY uuid,type"
data_sql = f"select uuid,type,sum(amount) as amount,create_time,reference_type,amount_type from {self.date} where reference_type='{self.reference_type}' GROUP BY uuid,type"
guild_sql = f"select uuid from guild"
account_sql = f"select uuid,name from fi_account"
anchor_sql = f"select uuid from v2_user where is_achor in(1,2)"
......@@ -276,11 +276,27 @@ class ReferenceTypeClassification():
if op.get('uuid') in guild_data:
op['nickname'] = '公会'
elif op.get('uuid') in anchor_data:
op['nickname'] = '主播'
if op.get('reference_type') == 'studioGift':
if op.get('amount_type') == 'backpack':
op['nickname'] = '背包送出'
elif op.get('amount_type') == 'consumable':
op['nickname'] = '钻石送出'
else:
op['nickname'] = '主播'
else:
op['nickname'] = '主播'
elif account_dict.get(op['uuid']):
op['nickname'] = account_dict.get(op['uuid'])
else:
op['nickname'] = '用户'
if op.get('reference_type') == 'studioGift':
if op.get('amount_type') == 'backpack':
op['nickname'] = '背包送出'
elif op.get('amount_type') == 'consumable':
op['nickname'] = '钻石送出'
else:
op['nickname'] = '用户'
else:
op['nickname'] = '用户'
if op.get('type') == 0:
self.outcome.append(op)
else:
......
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