ck 4 lat temu
rodzic
commit
53cb5c0ad3
2 zmienionych plików z 3 dodań i 4 usunięć
  1. 2 3
      data_manage/pitcher_panel.py
  2. 1 1
      model/CommonUtils.py

+ 2 - 3
data_manage/pitcher_panel.py

@@ -21,7 +21,6 @@ def get_pitcher_panel_channel(pitcher,channel,start,end,page,page_size,order_by,
            toDecimal32(if(follow_user=0,0,cost/follow_user),2) follow_per_cost,
            toDecimal32(if(follow_user=0,0,cost/follow_user),2) follow_per_cost,
             total_cost,
             total_cost,
            toDecimal32(if(total_cost=0,0,total_amount/total_cost),2) back_rate
            toDecimal32(if(total_cost=0,0,total_amount/total_cost),2) back_rate
-    
            from dw_daily_channel where dt>='{start}' and dt<='{end}'  """
            from dw_daily_channel where dt>='{start}' and dt<='{end}'  """
     if pitcher!='all':
     if pitcher!='all':
         sql += f" and pitcher='{pitcher}' "
         sql += f" and pitcher='{pitcher}' "
@@ -37,7 +36,8 @@ def get_pitcher_panel_channel(pitcher,channel,start,end,page,page_size,order_by,
          'first_order_count','first_per_cost','view_count','click_count','follow_user','follow_rate','follow_per_cost',
          'first_order_count','first_per_cost','view_count','click_count','follow_user','follow_rate','follow_per_cost',
          'total_cost','back_rate']
          'total_cost','back_rate']
 
 
-    return get_dict_list(key,data)
+
+    return get_dict_list(key,get_round(data))
 
 
 
 
 def get_pitcher_panel_daily(pitcher, start, end, page, page_size, order_by, order):
 def get_pitcher_panel_daily(pitcher, start, end, page, page_size, order_by, order):
@@ -383,7 +383,6 @@ def get_channel_order_trend(channel,start,end):
     }]
     }]
     return a
     return a
 
 
-
 def get_channel_summary(channel,pitcher,page,page_size,order_by,order):
 def get_channel_summary(channel,pitcher,page,page_size,order_by,order):
     sql = """select a.channel,state,'朋友圈' location,toString(start) start,toString(end) end,total_cost,total_amount,
     sql = """select a.channel,state,'朋友圈' location,toString(start) start,toString(end) end,total_cost,total_amount,
                         profit,roi,follow_user,follow_per_cost,order_user,
                         profit,roi,follow_user,follow_per_cost,order_user,

+ 1 - 1
model/CommonUtils.py

@@ -25,7 +25,7 @@ def get_round(li):
                 x.append(round(j,2))
                 x.append(round(j,2))
             else:
             else:
                 x.append(j)
                 x.append(j)
-            y.append(x)
+        y.append(x)
     return y
     return y