From e88008cb791b88cb83834edc9b3e29316a74e05b Mon Sep 17 00:00:00 2001 From: pengtao Date: Tue, 22 Oct 2019 15:45:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=BC=E5=87=BA=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- daily_report/dreport.py | 13 +++++++++++-- daily_report/templates/report.html | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/daily_report/dreport.py b/daily_report/dreport.py index 8607aa4..585a4f5 100644 --- a/daily_report/dreport.py +++ b/daily_report/dreport.py @@ -164,7 +164,14 @@ class Report: and "channel"='{self.channelid}' AND activity_id=201 and "$part_date"='{self.day}' """ - + jumpout_sql = f"""SELECT + count(distinct "#account_id") + FROM + v_event_19 + where + "$part_event"='event_1_4' + and "$part_date"='{self.day}' + and "jump_result"=1 """ try: activa = self.tga.get_data(activa_sql)[0][0] new = self.tga.get_data(new_sql)[0][0] @@ -173,7 +180,9 @@ class Report: ad_101 = self.tga.get_data(ad_101_sql)[0][0] ad_1 = self.tga.get_data(ad_1_sql)[0][0] ad_201 = self.tga.get_data(ad_201_sql)[0][0] - return [activa, new, share, timeonlie, ad_1, ad_101, ad_201] + jumpout = self.tga.get_data(jumpout_sql)[0][0] + jump_per = (100 * jumpout) / activa + return [activa, new, share, timeonlie, ad_1, ad_101, ad_201, jump_per] except Exception: log.error(f"get data from tga failed ,{self.gameid}", exc_info=True) return None diff --git a/daily_report/templates/report.html b/daily_report/templates/report.html index c6b0917..28bbe42 100644 --- a/daily_report/templates/report.html +++ b/daily_report/templates/report.html @@ -28,6 +28,7 @@ 视屏显示 banner显示 插屏显示 + 导出率 {% for item in data.get('all') %}