ck 4 rokov pred
rodič
commit
d5db9a633f
1 zmenil súbory, kde vykonal 3 pridanie a 3 odobranie
  1. 3 3
      data_manage/pitcher_panel.py

+ 3 - 3
data_manage/pitcher_panel.py

@@ -184,7 +184,7 @@ def get_channel_again_order_trend(channel,date,pitcher):
          'reg_count','reg_user','cost_per_user','avg_order_amount','avg_again_order_rate','order_count']
     json1=get_dict_list(key1,data)[0]
     # print(json1)
-    sql2="""select
+    sql2=f"""select
                date ,
                count(1) c1,
                sum(if(count>1,1,0)) c2,
@@ -195,8 +195,8 @@ def get_channel_again_order_trend(channel,date,pitcher):
         from (
         
         select count(1) count,date
-            from order where channel='玉龙书社' and date>='2020-09-19' and date<=addDays(toDate('2020-09-19'),6)
-                         and formatDateTime(reg_time,'%Y-%m-%d')='2020-09-19'  group by user_id,date
+            from order where channel='{channel}' and date>='{date}' and date<=addDays(toDate('{date}'),6)
+                         and formatDateTime(reg_time,'%Y-%m-%d')='{date}'  group by user_id,date
             ) a group by date"""
 
     df=ck.getData_pd(sql2,[['date','c1','c2','c3','c4','c5']])