|
@@ -8,50 +8,48 @@
|
|
|
SELECT
|
|
|
unit_id AS unitId,
|
|
|
unit_name as unitName,
|
|
|
- aclick as aclick,
|
|
|
- bclick as bclick,
|
|
|
- charge as cost,
|
|
|
- `show` as photoShow,
|
|
|
- photo_click_ratio as clickRate,
|
|
|
- action_ratio as bClickRate,
|
|
|
- impression_1k_cost as cpm,
|
|
|
- photo_click_cost as cpc,
|
|
|
- action_cost as cpb,
|
|
|
- download_started as downloadStart,
|
|
|
- download_completed as downloadFinish,
|
|
|
- activation as active,
|
|
|
- event_pay_first_day as firstDayPay,
|
|
|
- event_pay_purchase_amount_first_day as firstDayPayAmount,
|
|
|
- event_pay_first_day_roi as firstDayPayROI,
|
|
|
- event_pay_roi as ROI,
|
|
|
- event_register as register,
|
|
|
- event_register_cost as activeRegisterCost,
|
|
|
- event_register_ratio as activeRegisterRate,
|
|
|
- event_next_day_stay as nextDayOpen,
|
|
|
- event_next_day_stay_cost as nextDayOpenCost,
|
|
|
- event_next_day_stay_ratio as nextDayOpenRate,
|
|
|
- event_credit_grant_landing_page_ratio as eventCreditGrantLandingPageRate,
|
|
|
- play_3s_ratio as play3sRate,
|
|
|
- form_cost as formCountCost,
|
|
|
- form_action_ratio as formCountRate,
|
|
|
- event_button_click_cost as submitCost,
|
|
|
- event_button_click_ratio as submitRate,
|
|
|
- charge as cost,
|
|
|
- `show` as photoShow,
|
|
|
- CONCAT(ROUND(download_started / bclick * 100,2) ,'%') as downloadStartRate,
|
|
|
- ROUND(download_started / bclick * 100,2) as downloadStartCost,
|
|
|
- CONCAT(ROUND(download_completed / download_started * 100,2) ,'%') as downloadFinishRate,
|
|
|
- ROUND(charge / download_completed * 100,2) as downloadFinishCost,
|
|
|
- ROUND(charge / activation * 100,2) as activeCost,
|
|
|
- CONCAT(ROUND(activation / download_completed * 100,2) ,'%') as activeRate,
|
|
|
- ROUND(charge / event_pay_first_day * 100,2) as firstDayPayCost
|
|
|
+ sum( aclick ) AS aclick,
|
|
|
+ sum( bclick ) AS bclick,
|
|
|
+ sum( charge ) AS cost,
|
|
|
+ sum( `show` ) AS photoShow,
|
|
|
+ sum( photo_click_ratio ) AS clickRate,
|
|
|
+ sum( action_ratio ) AS bClickRate,
|
|
|
+ sum( impression_1k_cost ) AS cpm,
|
|
|
+ sum( photo_click_cost ) AS cpc,
|
|
|
+ sum( action_cost ) AS cpb,
|
|
|
+ sum( download_started ) AS downloadStart,
|
|
|
+ sum( download_completed ) AS downloadFinish,
|
|
|
+ sum( activation ) AS active,
|
|
|
+ sum( event_pay_first_day ) AS firstDayPay,
|
|
|
+ sum( event_pay_purchase_amount_first_day ) AS firstDayPayAmount,
|
|
|
+ sum( event_pay_first_day_roi ) AS firstDayPayROI,
|
|
|
+ sum( event_pay_roi ) AS ROI,
|
|
|
+ sum( event_register ) AS register,
|
|
|
+ sum( event_register_cost ) AS activeRegisterCost,
|
|
|
+ sum( event_register_ratio ) AS activeRegisterRate,
|
|
|
+ sum( event_next_day_stay ) AS nextDayOpen,
|
|
|
+ sum( event_next_day_stay_cost ) AS nextDayOpenCost,
|
|
|
+ sum( event_next_day_stay_ratio ) AS nextDayOpenRate,
|
|
|
+ sum( event_credit_grant_landing_page_ratio ) AS eventCreditGrantLandingPageRate,
|
|
|
+ sum( play_3s_ratio ) AS play3sRate,
|
|
|
+ sum( form_cost ) AS formCountCost,
|
|
|
+ sum( form_action_ratio ) AS formCountRate,
|
|
|
+ sum( event_button_click_cost ) AS submitCost,
|
|
|
+ sum( event_button_click_ratio ) AS submitRate,
|
|
|
+ CONCAT( ROUND( sum( download_started ) / sum( bclick ) * 100, 2 ), '%' ) AS downloadStartRate,
|
|
|
+ ROUND( sum(download_started) / sum(bclick) * 100, 2 ) AS downloadStartCost,
|
|
|
+ CONCAT( ROUND( sum( download_completed ) / sum( download_started ) * 100, 2 ), '%' ) AS downloadFinishRate,
|
|
|
+ ROUND( sum( charge ) / sum( download_completed ) * 100, 2 ) AS downloadFinishCost,
|
|
|
+ ROUND( sum( charge ) / sum( activation ) * 100, 2 ) AS activeCost,
|
|
|
+ CONCAT( ROUND( sum( activation ) / sum( download_completed ) * 100, 2 ), '%' ) AS activeRate,
|
|
|
+ ROUND( sum( charge ) / sum( event_pay_first_day ) * 100, 2 ) AS firstDayPayCost
|
|
|
FROM
|
|
|
media_api.`kuaishou_unit_report_hourly`
|
|
|
WHERE
|
|
|
stat_date >= #{startTime}
|
|
|
AND stat_date <= #{endTime}
|
|
|
AND advertiser_id = #{advertiserId}
|
|
|
- ORDER BY charge DESC
|
|
|
+ ORDER BY sum( charge ) DESC
|
|
|
LIMIT 10
|
|
|
</select>
|
|
|
|
|
@@ -62,50 +60,48 @@
|
|
|
SELECT
|
|
|
unit_id AS unitId,
|
|
|
unit_name as unitName,
|
|
|
- aclick as aclick,
|
|
|
- bclick as bclick,
|
|
|
- charge as cost,
|
|
|
- `show` as photoShow,
|
|
|
- photo_click_ratio as clickRate,
|
|
|
- action_ratio as bClickRate,
|
|
|
- impression_1k_cost as cpm,
|
|
|
- photo_click_cost as cpc,
|
|
|
- action_cost as cpb,
|
|
|
- download_started as downloadStart,
|
|
|
- download_completed as downloadFinish,
|
|
|
- activation as active,
|
|
|
- event_pay_first_day as firstDayPay,
|
|
|
- event_pay_purchase_amount_first_day as firstDayPayAmount,
|
|
|
- event_pay_first_day_roi as firstDayPayROI,
|
|
|
- event_pay_roi as ROI,
|
|
|
- event_register as register,
|
|
|
- event_register_cost as activeRegisterCost,
|
|
|
- event_register_ratio as activeRegisterRate,
|
|
|
- event_next_day_stay as nextDayOpen,
|
|
|
- event_next_day_stay_cost as nextDayOpenCost,
|
|
|
- event_next_day_stay_ratio as nextDayOpenRate,
|
|
|
- event_credit_grant_landing_page_ratio as eventCreditGrantLandingPageRate,
|
|
|
- play_3s_ratio as play3sRate,
|
|
|
- form_cost as formCountCost,
|
|
|
- form_action_ratio as formCountRate,
|
|
|
- event_button_click_cost as submitCost,
|
|
|
- event_button_click_ratio as submitRate,
|
|
|
- charge as cost,
|
|
|
- `show` as photoShow,
|
|
|
- CONCAT(ROUND(download_started / bclick * 100,2) ,'%') as downloadStartRate,
|
|
|
- ROUND(download_started / bclick * 100,2) as downloadStartCost,
|
|
|
- CONCAT(ROUND(download_completed / download_started * 100,2) ,'%') as downloadFinishRate,
|
|
|
- ROUND(charge / download_completed * 100,2) as downloadFinishCost,
|
|
|
- ROUND(charge / activation * 100,2) as activeCost,
|
|
|
- CONCAT(ROUND(activation / download_completed * 100,2) ,'%') as activeRate,
|
|
|
- ROUND(charge / event_pay_first_day * 100,2) as firstDayPayCost
|
|
|
+ sum( aclick ) AS aclick,
|
|
|
+ sum( bclick ) AS bclick,
|
|
|
+ sum( charge ) AS cost,
|
|
|
+ sum( `show` ) AS photoShow,
|
|
|
+ sum( photo_click_ratio ) AS clickRate,
|
|
|
+ sum( action_ratio ) AS bClickRate,
|
|
|
+ sum( impression_1k_cost ) AS cpm,
|
|
|
+ sum( photo_click_cost ) AS cpc,
|
|
|
+ sum( action_cost ) AS cpb,
|
|
|
+ sum( download_started ) AS downloadStart,
|
|
|
+ sum( download_completed ) AS downloadFinish,
|
|
|
+ sum( activation ) AS active,
|
|
|
+ sum( event_pay_first_day ) AS firstDayPay,
|
|
|
+ sum( event_pay_purchase_amount_first_day ) AS firstDayPayAmount,
|
|
|
+ sum( event_pay_first_day_roi ) AS firstDayPayROI,
|
|
|
+ sum( event_pay_roi ) AS ROI,
|
|
|
+ sum( event_register ) AS register,
|
|
|
+ sum( event_register_cost ) AS activeRegisterCost,
|
|
|
+ sum( event_register_ratio ) AS activeRegisterRate,
|
|
|
+ sum( event_next_day_stay ) AS nextDayOpen,
|
|
|
+ sum( event_next_day_stay_cost ) AS nextDayOpenCost,
|
|
|
+ sum( event_next_day_stay_ratio ) AS nextDayOpenRate,
|
|
|
+ sum( event_credit_grant_landing_page_ratio ) AS eventCreditGrantLandingPageRate,
|
|
|
+ sum( play_3s_ratio ) AS play3sRate,
|
|
|
+ sum( form_cost ) AS formCountCost,
|
|
|
+ sum( form_action_ratio ) AS formCountRate,
|
|
|
+ sum( event_button_click_cost ) AS submitCost,
|
|
|
+ sum( event_button_click_ratio ) AS submitRate,
|
|
|
+ CONCAT( ROUND( sum( download_started ) / sum( bclick ) * 100, 2 ), '%' ) AS downloadStartRate,
|
|
|
+ ROUND( sum(download_started) / sum(bclick) * 100, 2 ) AS downloadStartCost,
|
|
|
+ CONCAT( ROUND( sum( download_completed ) / sum( download_started ) * 100, 2 ), '%' ) AS downloadFinishRate,
|
|
|
+ ROUND( sum( charge ) / sum( download_completed ) * 100, 2 ) AS downloadFinishCost,
|
|
|
+ ROUND( sum( charge ) / sum( activation ) * 100, 2 ) AS activeCost,
|
|
|
+ CONCAT( ROUND( sum( activation ) / sum( download_completed ) * 100, 2 ), '%' ) AS activeRate,
|
|
|
+ ROUND( sum( charge ) / sum( event_pay_first_day ) * 100, 2 ) AS firstDayPayCost
|
|
|
FROM
|
|
|
media_api.`kuaishou_unit_report_daily`
|
|
|
WHERE
|
|
|
stat_date >= #{startTime}
|
|
|
AND stat_date <= #{endTime}
|
|
|
AND advertiser_id = #{advertiserId}
|
|
|
- ORDER BY charge DESC
|
|
|
+ ORDER BY sum( charge ) DESC
|
|
|
LIMIT 10
|
|
|
</select>
|
|
|
|