|
@@ -134,7 +134,7 @@ def get_channel_overview(channel,pitcher,start,end,page,page_size,order_by,order
|
|
first_order_amount,
|
|
first_order_amount,
|
|
order_count,order_user,
|
|
order_count,order_user,
|
|
order_amount,
|
|
order_amount,
|
|
- order_amount-first_order_amount,
|
|
|
|
|
|
+ order_amount-first_order_amount old_order_amount,
|
|
round(if(first_order_user=0,0,first_order_amount/first_order_user),2) first_amount_per_user,
|
|
round(if(first_order_user=0,0,first_order_amount/first_order_user),2) first_amount_per_user,
|
|
round(if(follow_user=0,0,first_order_amount/follow_user),2) amount_per_follow,
|
|
round(if(follow_user=0,0,first_order_amount/follow_user),2) amount_per_follow,
|
|
round(if(first_order_user=0,0,cost/first_order_user),2) first_cost_per_user,
|
|
round(if(first_order_user=0,0,cost/first_order_user),2) first_cost_per_user,
|
|
@@ -142,12 +142,43 @@ def get_channel_overview(channel,pitcher,start,end,page,page_size,order_by,order
|
|
reg_order_amount,
|
|
reg_order_amount,
|
|
round(if(cost=0,0,first_order_amount/cost),4) day_roi,
|
|
round(if(cost=0,0,first_order_amount/cost),4) day_roi,
|
|
round(order_amount/cost,4) roi,
|
|
round(order_amount/cost,4) roi,
|
|
- round(if(total_cost=0,0,total_first_amount/total_cost),4) avg_new_order_rate,
|
|
|
|
|
|
+ reg_order_user_again,
|
|
|
|
+ reg_order_user,
|
|
round(if(reg_order_user=0,0,reg_order_user_again/reg_order_user),4) old_user_once_order_rate,
|
|
round(if(reg_order_user=0,0,reg_order_user_again/reg_order_user),4) old_user_once_order_rate,
|
|
pitcher,stage from dw_channel_daily where 1=1 {op1} {op2} {op3} {op4} {op5} """
|
|
pitcher,stage from dw_channel_daily where 1=1 {op1} {op2} {op3} {op4} {op5} """
|
|
|
|
|
|
print(sql)
|
|
print(sql)
|
|
- return getLimitData(db.quchen_text,sql,page,page_size)
|
|
|
|
|
|
+ sumsql=f"""select '总计' date,
|
|
|
|
+ sum(view_count) view_count,
|
|
|
|
+ sum(click_count) click_count,
|
|
|
|
+ round(sum(click_count)/sum(view_count),4) click_rate,
|
|
|
|
+sum(follow_user) follow_user,
|
|
|
|
+round(sum(follow_user)/sum(click_count),4) follow_rate,
|
|
|
|
+round(sum(cost)/sum(follow_user),2) follow_per_cost,
|
|
|
|
+round(sum(first_order_count)/sum(click_count),4) order_rate,
|
|
|
|
+round(sum(cost)/sum(first_order_user),2) order_per_cost,
|
|
|
|
+sum(cost) cost,
|
|
|
|
+sum(first_order_count) first_order_count,
|
|
|
|
+sum(first_order_user) first_order_user,
|
|
|
|
+sum(first_order_amount) first_order_amount,
|
|
|
|
+sum(order_count) order_count,
|
|
|
|
+sum(order_user) order_user,
|
|
|
|
+sum(order_amount) order_amount,
|
|
|
|
+sum(old_order_amount) old_order_amount,
|
|
|
|
+round(sum(first_order_amount)/sum(first_order_user),2) first_amount_per_user,
|
|
|
|
+round(sum(first_order_amount)/sum(follow_user),2) amount_per_follow,
|
|
|
|
+round(sum(cost)/sum(first_order_user),2) first_cost_per_user,
|
|
|
|
+round(sum(first_order_user)/sum(follow_user),4) new_user_order_rate,
|
|
|
|
+sum(reg_order_amount) reg_order_amount,
|
|
|
|
+round(sum(first_order_amount)/sum(cost),4) day_roi,
|
|
|
|
+round(sum(order_amount)/sum(cost),4) roi,
|
|
|
|
+round(sum(reg_order_user_again)/sum(reg_order_user),4) old_user_once_order_rate
|
|
|
|
+from ({sql}) a
|
|
|
|
+
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return getLimitSumData(db.quchen_text,sql,sumsql,page,page_size)
|
|
|
|
|
|
|
|
|
|
def get_channel_again_order_trend(channel,date,pitcher):
|
|
def get_channel_again_order_trend(channel,date,pitcher):
|