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: