From ab099049e5376e7a07af46f479fbe2e1dbbf7a57 Mon Sep 17 00:00:00 2001 From: pengtao Date: Mon, 28 Oct 2019 14:31:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E6=97=A5=E6=8A=A5=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- daily_report/dreport.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/daily_report/dreport.py b/daily_report/dreport.py index ebe44d5..81a1c8b 100644 --- a/daily_report/dreport.py +++ b/daily_report/dreport.py @@ -205,14 +205,14 @@ class Report: and "button_name" like 'wx%_success'""" try: - activa = args['tga'].get_data(activa_sql)[0][0] - new = args['tga'].get_data(new_sql)[0][0] - share = args['tga'].get_data(share_sql)[0][0] + activa = args['tga'].get_data(activa_sql)[0][0] or 0 + new = args['tga'].get_data(new_sql)[0][0] or 0 + share = args['tga'].get_data(share_sql)[0][0] or 0 timeonlie = round(int(args['tga'].get_data(timeonlie_sql)[0][0] or 0) / activa, 2) - ad_101 = args['tga'].get_data(ad_101_sql)[0][0] - ad_1 = args['tga'].get_data(ad_1_sql)[0][0] - ad_201 = args['tga'].get_data(ad_201_sql)[0][0] - jumpout = args['tga'].get_data(jumpout_sql)[0][0] + ad_101 = args['tga'].get_data(ad_101_sql)[0][0] or 0 + ad_1 = args['tga'].get_data(ad_1_sql)[0][0] or 0 + ad_201 = args['tga'].get_data(ad_201_sql)[0][0] or 0 + jumpout = args['tga'].get_data(jumpout_sql)[0][0] or 0 jump_per = round((100 * jumpout) / activa, 2) return [activa, new, share, timeonlie, ad_1, ad_101, ad_201, jump_per] except Exception: