ck il y a 4 ans
Parent
commit
fd21d0d23c
2 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 2 2
      data_manage/pitcher_panel.py
  2. 2 2
      model/CommonUtils.py

+ 2 - 2
data_manage/pitcher_panel.py

@@ -51,7 +51,7 @@ def get_pitcher_panel_channel(pitcher,channel,start,end,page,page_size,order_by,
          'total_cost','back_rate']
 
 
-    return get_dict_list(key,get_round(data)),total
+    return get_dict_list(key,get_round(data,4)),total
 
 
 def get_pitcher_panel_daily(pitcher, start, end, page, page_size, order_by, order):
@@ -716,7 +716,7 @@ def get_channel_summary(channel,pitcher,page,page_size,order_by,order,state):
                        channel,
                        total_amount-total_cost profit,
                        if(total_cost=0,0,total_amount/total_cost) roi
-                from dw_channel_daily_total where dt=subtractDays(today(),1) {channel_op}) d on a.channel=d.channel 
+                from dw_channel_daily_total where dt=today() {channel_op}) d on a.channel=d.channel 
                 """
     print(sql)
     if channel!='':

+ 2 - 2
model/CommonUtils.py

@@ -12,7 +12,7 @@ def get_dict_list(key,value_list):
     return data_list
 
 
-def get_round(li):
+def get_round(li,p=2):
     """
 
     :param li: [[]] or [()]
@@ -23,7 +23,7 @@ def get_round(li):
         x = []
         for j in i:
             if isinstance(j,float):
-                x.append(round(j,2))
+                x.append(round(j,p))
             else:
                 x.append(j)
         y.append(x)