From 4c90896f5dac0a50333bede6ccfa806c8ab4e98d Mon Sep 17 00:00:00 2001 From: pengtao Date: Thu, 24 Oct 2019 11:14:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=A0=E9=80=92=E6=97=A5=E6=9C=9F=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- daily_report/dreport.py | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) 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: