diff --git a/daily_report/dreport.py b/daily_report/dreport.py index 9d2f7e5..5058756 100644 --- a/daily_report/dreport.py +++ b/daily_report/dreport.py @@ -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: