Browse Source

修改内容:广告监控添加字段

lth 1 năm trước cách đây
mục cha
commit
070bc60f5c

+ 23 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/PromotionDayServiceImpl.java

@@ -539,7 +539,17 @@ public class PromotionDayServiceImpl implements IAdsPromotionDayService {
                 	SUM(d3) as d3,
                 	SUM(d7) as d7,
                 	SUM(d15) as d15,
-                	SUM(active) as active
+                	IFNULL(SUM(active), 0) as active,
+                    ROUND(IF(SUM(active) > 0, SUM(today_cost) / SUM(active), 0), 2) as active_cost,
+                    IFNULL(SUM(first_convert_count), 0) as first_convert_count,
+                    ROUND(IF(SUM(first_convert_count) > 0, SUM(today_cost) / SUM(first_convert_count), 0), 2) as first_convert_cost,
+                    ROUND(IF(SUM(active) > 0, SUM(game_pay_count) / SUM(active), 0), 4) as first_active_pay_rate,
+                    SUM(first_attribution_game_in_app_ltv1day) as first_attribution_game_in_app_ltv1day,
+                    ROUND(IF(SUM(today_cost) > 0 , SUM(first_attribution_game_in_app_ltv1day) / SUM(today_cost), 0), 4) as first_attribution_game_in_app_roi1day,
+                    SUM(game_pay_count) as game_pay_count,
+                    ROUND(IF(SUM(reg_num) > 0, SUM(first_attribution_game_in_app_ltv1day) / SUM(reg_num), 0), 2) as ltv_day1,
+                    (SUM(first_new_user_amount_count) - SUM(game_pay_count)) as sub_order_num,
+                    (SUM(first_new_user_amount) - SUM(first_attribution_game_in_app_ltv1day)) as sub_order_amount
                 FROM
                 	game_ads.ads_promotion_day
                 """;
@@ -647,7 +657,18 @@ public class PromotionDayServiceImpl implements IAdsPromotionDayService {
                 	IFNULL(SUM(d2), 0) as d2,
                 	IFNULL(SUM(d3), 0) as d3,
                 	IFNULL(SUM(d7), 0) as d7,
-                	IFNULL(SUM(d15), 0) as d15
+                	IFNULL(SUM(d15), 0) as d15,
+                	IFNULL(SUM(active), 0) as active,
+                    ROUND(IF(SUM(active) > 0, SUM(today_cost) / SUM(active), 0), 2) as active_cost,
+                    IFNULL(SUM(first_convert_count), 0) as first_convert_count,
+                    ROUND(IF(SUM(first_convert_count) > 0, SUM(today_cost) / SUM(first_convert_count), 0), 2) as first_convert_cost,
+                    ROUND(IF(SUM(active) > 0, SUM(game_pay_count) / SUM(active), 0), 4) as first_active_pay_rate,
+                    SUM(first_attribution_game_in_app_ltv1day) as first_attribution_game_in_app_ltv1day,
+                    ROUND(IF(SUM(today_cost) > 0 , SUM(first_attribution_game_in_app_ltv1day) / SUM(today_cost), 0), 4) as first_attribution_game_in_app_roi1day,
+                    SUM(game_pay_count) as game_pay_count,
+                    ROUND(IF(SUM(reg_num) > 0, SUM(first_attribution_game_in_app_ltv1day) / SUM(reg_num), 0), 2) as ltv_day1,
+                    (SUM(first_new_user_amount_count) - SUM(game_pay_count)) as sub_order_num,
+                    (SUM(first_new_user_amount) - SUM(first_attribution_game_in_app_ltv1day)) as sub_order_amount
                 FROM
                 	game_ads.ads_promotion_day
                 """;