传递日期参数

This commit is contained in:
pengtao 2019-10-24 11:14:37 +08:00
parent 9202ff768e
commit 4c90896f5d

View File

@ -262,17 +262,30 @@ class Report:
def get_output_fromappid(self, **args):
jump_sql = f"""SELECT
count("#account_id"),count(distinct "#account_id")
FROM
v_event_{args['suffix']}
where
"$part_event"='event_1_4'
and gameid='{args['gameid']}'
and "channel"='{args['channelid']}'
and "$part_date"='{self.day}'
and "jump_appid"='{args['fromappid']}'
and "jump_result"=1 """
if args['gameid'] in (2001, 2002):
jump_sql = f"""SELECT
count("#account_id"),count(distinct "#account_id")
FROM
v_event_{args['suffix']}
where
"$part_event"='event_1_4'
and gameid='{args['gameid']}'
and "channel"='{args['channelid']}'
and "$part_date"='{self.day}'
and "jump_appid"='{args['fromappid']}'
and "jump_result"=1 """
else:
jump_sql = f"""SELECT
count("#account_id"),count(distinct "#account_id")
FROM
v_event_{args['suffix']}
where
"$part_event"='event_11_31'
and gameid='{args['gameid']}'
and "channel"='{args['channelid']}'
and "$part_date"='{self.day}'
and "button_name" ='jc_promotipn'
and cast(json_extract(trim(button_param,'[]"'),'$.appid') as varchar)='{args['fromappid']}'"""
data = args['tga'].get_data(jump_sql)
if data: