|
@@ -1551,7 +1551,7 @@ public class PromotionDayServiceImpl implements IAdsPromotionDayService {
|
|
|
IFNULL(SUM(d15), 0) as d15,
|
|
|
IFNULL(SUM(mini_game_register_users), 0) as mini_game_register_users,
|
|
|
IFNULL(SUM(mini_game_register_cost), 0) as mini_game_register_cost,
|
|
|
- IFNULL(SUM(mini_game_register_rate), 0) as mini_game_register_rate,
|
|
|
+ ROUND(IF(SUM(click_count) > 0, SUM(mini_game_register_users) / SUM(click_count), 0), 4) as mini_game_register_rate,
|
|
|
IFNULL(SUM(mini_game_paying_count), 0) as mini_game_paying_count,
|
|
|
IFNULL(SUM(mini_game_paying_amount), 0) as mini_game_paying_amount,
|
|
|
IFNULL(SUM(mini_game_paying_users_d1), 0) as mini_game_paying_users_d1,
|
|
@@ -1583,46 +1583,46 @@ public class PromotionDayServiceImpl implements IAdsPromotionDayService {
|
|
|
game_ads.ads_adgroup_day
|
|
|
""" + criA +
|
|
|
"""
|
|
|
- ) b
|
|
|
- LEFT JOIN(
|
|
|
- SELECT
|
|
|
- *
|
|
|
- FROM(
|
|
|
- SELECT
|
|
|
- ROW_NUMBER()over(partition by promotion_id order by dt desc) as num,
|
|
|
- promotion_id,
|
|
|
- status,
|
|
|
- creative_preview,
|
|
|
- landing_type,
|
|
|
- pricing,
|
|
|
- cpa_bid,
|
|
|
- roi_goal,
|
|
|
- budget,
|
|
|
- concat(start_time,'/',end_time) as schedule_time,
|
|
|
- notes,
|
|
|
- service,
|
|
|
- balance,
|
|
|
- promotion_total_cost,
|
|
|
- convert_target,
|
|
|
- reg_total_num,
|
|
|
- role_total_num,
|
|
|
- reg_total_cost,
|
|
|
- role_total_cost,
|
|
|
- role_total_rate,
|
|
|
- total_amount_count,
|
|
|
- total_amount_num,
|
|
|
- total_amount,
|
|
|
- promotion_total_roi,
|
|
|
- ROUND(IF(total_amount_count > 0, promotion_total_cost / total_amount_count, 0), 2) as total_amount_count_cost,
|
|
|
- total_recharge_cost
|
|
|
- FROM
|
|
|
- game_ads.ads_adgroup_day
|
|
|
- """ + criB +
|
|
|
- """
|
|
|
- ) a
|
|
|
- WHERE a.num = 1) c
|
|
|
- ON b.promotion_id = c.promotion_id
|
|
|
- """;
|
|
|
+ ) b
|
|
|
+ LEFT JOIN(
|
|
|
+ SELECT
|
|
|
+ *
|
|
|
+ FROM(
|
|
|
+ SELECT
|
|
|
+ ROW_NUMBER()over(partition by promotion_id order by dt desc) as num,
|
|
|
+ promotion_id,
|
|
|
+ status,
|
|
|
+ creative_preview,
|
|
|
+ landing_type,
|
|
|
+ pricing,
|
|
|
+ cpa_bid,
|
|
|
+ roi_goal,
|
|
|
+ budget,
|
|
|
+ concat(start_time,'/',end_time) as schedule_time,
|
|
|
+ notes,
|
|
|
+ service,
|
|
|
+ balance,
|
|
|
+ promotion_total_cost,
|
|
|
+ convert_target,
|
|
|
+ reg_total_num,
|
|
|
+ role_total_num,
|
|
|
+ reg_total_cost,
|
|
|
+ role_total_cost,
|
|
|
+ role_total_rate,
|
|
|
+ total_amount_count,
|
|
|
+ total_amount_num,
|
|
|
+ total_amount,
|
|
|
+ promotion_total_roi,
|
|
|
+ ROUND(IF(total_amount_count > 0, promotion_total_cost / total_amount_count, 0), 2) as total_amount_count_cost,
|
|
|
+ total_recharge_cost
|
|
|
+ FROM
|
|
|
+ game_ads.ads_adgroup_day
|
|
|
+ """ + criB +
|
|
|
+ """
|
|
|
+ ) a
|
|
|
+ WHERE a.num = 1) c
|
|
|
+ ON b.promotion_id = c.promotion_id
|
|
|
+ """;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1694,7 +1694,7 @@ public class PromotionDayServiceImpl implements IAdsPromotionDayService {
|
|
|
IFNULL(SUM(d15), 0) as d15,
|
|
|
IFNULL(SUM(mini_game_register_users), 0) as mini_game_register_users,
|
|
|
IFNULL(SUM(mini_game_register_cost), 0) as mini_game_register_cost,
|
|
|
- IFNULL(SUM(mini_game_register_rate), 0) as mini_game_register_rate,
|
|
|
+ ROUND(IF(SUM(click_count) > 0 , SUM(mini_game_register_users) / SUM(click_count), 0), 4) as mini_game_register_rate,
|
|
|
IFNULL(SUM(mini_game_paying_count), 0) as mini_game_paying_count,
|
|
|
IFNULL(SUM(mini_game_paying_amount), 0) as mini_game_paying_amount,
|
|
|
IFNULL(SUM(mini_game_paying_users_d1), 0) as mini_game_paying_users_d1,
|