|
@@ -326,7 +326,7 @@ def get_channel_active(channel,pitcher,start,end,page,page_size,order_by,order):
|
|
|
else:
|
|
|
pitcher_op = f" and channel in {get_channels_from_user(pitcher)}"
|
|
|
|
|
|
- sql=f"""select pitcher,formatDateTime(a.dt,'%Y-%m-%d') date,channel,book,toDecimal32(cost,2),toDecimal32(reg_amount,2),roi,new_follow_user,toDecimal32(new_follow_per_cost,2),order_user,order_count,
|
|
|
+ sql=f"""select stage,pitcher,formatDateTime(a.dt,'%Y-%m-%d') date,channel,book,toDecimal32(cost,2),toDecimal32(reg_amount,2),roi,new_follow_user,toDecimal32(new_follow_per_cost,2),order_user,order_count,
|
|
|
toDecimal32(order_user_per_cost,2),day7_avg_act_rate,toDecimal32(day7_avg_act_per_cost,2),day30_avg_act_rate,toDecimal32(ay30_avg_act_cost,2),
|
|
|
toDecimal32(act_per_cost,2),
|
|
|
concat(toString(reg_order_user1),',',toString(if(reg_order_user1=0,0,cost/reg_order_user1)),',',toString(if(order_user=0,0,reg_order_user1/order_user))),
|
|
@@ -419,7 +419,7 @@ select toDate(formatDateTime(reg_time,'%Y-%m-%d')) dt,channel,
|
|
|
print(sql)
|
|
|
print(data)
|
|
|
|
|
|
- key=['pitcher','date','channel','book','cost','reg_amount','roi','new_follow_user','new_follow_per_cost','order_user','order_count','order_user_per_cost',
|
|
|
+ key=['stage','pitcher','date','channel','book','cost','reg_amount','roi','new_follow_user','new_follow_per_cost','order_user','order_count','order_user_per_cost',
|
|
|
'day7_avg_act_rate','day7_avg_act_per_cost','day30_avg_act_rate','day30_avg_act_cost','act_per_cost','d1','d2','d3','d4','d5','d6','d7','d8','d9','d10',
|
|
|
'd11','d12','d13','d14','d15','d16','d17','d18','d19','d20','d21','d22','d23','d24','d25','d26','d27','d28','d29','d30']
|
|
|
|
|
@@ -458,7 +458,7 @@ def get_channel_order_trend(channel,pitcher,start,end,page,page_size,order_by,or
|
|
|
else:
|
|
|
pitcher_op = f" and channel in {get_channels_from_user(pitcher)}"
|
|
|
|
|
|
- sql=f"""select pitcher,channel,toString(dt) date,book,toDecimal32(cost,2),toDecimal32(reg_order_amount,2),roi,new_follow_user,new_follow_per_cost,order_user,order_count,
|
|
|
+ sql=f"""select stage,pitcher,channel,toString(dt) date,book,toDecimal32(cost,2),toDecimal32(reg_order_amount,2),roi,new_follow_user,new_follow_per_cost,order_user,order_count,
|
|
|
toDecimal32(order_user_per_cost,2),
|
|
|
concat(toString(r1),',',toString(r1/cost),',', toString(a1/cost),',',toString(b1)),
|
|
|
concat(toString(a2),',',toString(r2/cost),',', toString(a2/cost),',',toString(b2)),
|
|
@@ -683,10 +683,10 @@ from order where dt>='{start}' {channel_op} group by formatDateTime(reg_time,'
|
|
|
|
|
|
for i in data:
|
|
|
for x,y in enumerate(i):
|
|
|
- if x>=12:
|
|
|
+ if x>=13:
|
|
|
i[x]=parse(y)
|
|
|
print(data)
|
|
|
- key=['pitcher','channel','date','book','cost','reg_amount','roi','new_follow_user','new_follow_per_cost','order_user','order_count',
|
|
|
+ key=['stage','pitcher','channel','date','book','cost','reg_amount','roi','new_follow_user','new_follow_per_cost','order_user','order_count',
|
|
|
'order_user_per_cost','d1','d2','d3','d4','d5','d6','d7','d8','d9','d10','d11','d12','d13','d14','d15','d16','d17','d18',
|
|
|
'd19','d20','d21','d22','d23','d24','d25','d26','d27','d28','d29','d30','d31','d32','d33','d34','d35','d36','d37','d38',
|
|
|
'd39','d40','d41','d42','d43','d44','d45','d46','d47','d48','d49','d50','d51','d52','d53','d54','d55','d56','d57','d58','d59',
|