|
@@ -27,7 +27,6 @@
|
|
|
else 0
|
|
|
end
|
|
|
) eventRegisterCost -- 注册成本
|
|
|
-
|
|
|
from
|
|
|
ctop_kuaishou_report_hourly_account
|
|
|
where stat_date = #{date}
|
|
@@ -57,7 +56,14 @@
|
|
|
(sum(charge) / sum(activation)) activationPrice, -- 激活单价
|
|
|
((sum(charge) / sum(activation)) / #{discount}) afterActivationPrice, -- 激活单价
|
|
|
account_id accountId,
|
|
|
- (select auth_name from ctop_user_allocation where account_id = accountId limit 1) accountName
|
|
|
+ (select auth_name from ctop_user_allocation where account_id = accountId limit 1) accountName,
|
|
|
+ sum(event_next_day_stay) eventNextDayStay, -- 次留数
|
|
|
+ (case
|
|
|
+ when sum(activation) != 0
|
|
|
+ then (sum(event_next_day_stay)/sum(activation))
|
|
|
+ else 0
|
|
|
+ end
|
|
|
+ ) eventNextDayStayRatio -- 次留率=次留数/激活数
|
|
|
from
|
|
|
ctop_kuaishou_report_daily_account
|
|
|
where account_id in
|
|
@@ -93,7 +99,14 @@
|
|
|
end
|
|
|
) eventRegisterCost, -- 注册成本
|
|
|
account_id accountId,
|
|
|
- (select auth_name from ctop_user_allocation where account_id = accountId limit 1) accountName
|
|
|
+ (select auth_name from ctop_user_allocation where account_id = accountId limit 1) accountName,
|
|
|
+ sum(event_next_day_stay) eventNextDayStay, -- 次留数
|
|
|
+ (case
|
|
|
+ when sum(activation) != 0
|
|
|
+ then (sum(event_next_day_stay)/sum(activation))
|
|
|
+ else 0
|
|
|
+ end
|
|
|
+ ) eventNextDayStayRatio -- 次留率=次留数/激活数
|
|
|
from
|
|
|
ctop_kuaishou_report_daily_account
|
|
|
where stat_date <= #{startDate}
|
|
@@ -167,7 +180,14 @@
|
|
|
end
|
|
|
) eventRegisterCost, -- 注册成本
|
|
|
account_id accountId,
|
|
|
- (select auth_name from ctop_user_allocation where account_id = accountId limit 1) accountName
|
|
|
+ (select auth_name from ctop_user_allocation where account_id = accountId limit 1) accountName,
|
|
|
+ sum(event_next_day_stay) eventNextDayStay, -- 次留数
|
|
|
+ (case
|
|
|
+ when sum(activation) != 0
|
|
|
+ then ( sum(event_next_day_stay) / sum(activation) )
|
|
|
+ else 0
|
|
|
+ end
|
|
|
+ ) eventNextDayStayRatio -- 次留率=次留数/激活数
|
|
|
from
|
|
|
ctop_kuaishou_report_daily_account
|
|
|
where stat_date = #{statDate}
|
|
@@ -430,7 +450,14 @@
|
|
|
then (sum(charge) / sum(event_register))
|
|
|
else 0
|
|
|
end
|
|
|
- ) eventRegisterCost -- 注册成本
|
|
|
+ ) eventRegisterCost, -- 注册成本
|
|
|
+ sum(event_next_day_stay) eventNextDayStay, -- 次留数
|
|
|
+ (case
|
|
|
+ when sum(activation) != 0
|
|
|
+ then (sum(event_next_day_stay)/sum(activation))
|
|
|
+ else 0
|
|
|
+ end
|
|
|
+ ) eventNextDayStayRatio -- 次留率=次留数/激活数
|
|
|
|
|
|
from
|
|
|
ctop_kuaishou_report_daily_account
|