Commit 1e77500e by 彭芳

[minor]: add report common filed

parent 6e61fe82
......@@ -22,12 +22,7 @@ func NewAdRepo(data *Data, logger log.Logger) biz.AdRepo {
func (p *adRepo) List(ctx context.Context, customerId int64, req *biz.ListReportRequest) (int64, biz.AdList, error) {
db := p.data.db.Table("ads_report_advertise_hour").
Select("advertise_id as ad_id,advertise_name as ad_name, campaign_id, campaign_name, advertiser_id, date_long AS stat_datetime, cost, `show`, click, `convert`, "+
"deep_convert, attribution_convert, attribution_deep_convert, download_start, download_finish, click_install, "+
"install_finish, active, register, next_day_open, next_day_open_cost, next_day_open_rate, attribution_next_day_open_cnt,"+
" game_addiction, pay_count, in_app_uv, in_app_detail_uv, in_app_cart, in_app_pay, in_app_order, attribution_game_pay_7d_count,"+
" game_pay_count, total_play, valid_play, play_25_feed_break, play_50_feed_break, play_75_feed_break, play_100_feed_break, "+
"play_duration_sum, attribution_active_pay_intra_one_day_count, attribution_active_pay_intra_one_day_amount, gmt_modified AS timestamp").
Select("advertise_id AS ad_id,advertise_name AS ad_name, "+reportCommonFiled).
Where("customer_id = ?", customerId).
Where("is_delete = ?", 0)
......
......@@ -26,12 +26,7 @@ func (p *campaignRepo) List(ctx context.Context, customerId int64, req *biz.List
tableName = "ads_report_campaign_hour"
}
db := p.data.db.Table(tableName).
Select("campaign_id, campaign_name, advertiser_id, date_long AS stat_datetime, cost, `show`, click, `convert`, "+
"deep_convert, attribution_convert, attribution_deep_convert, download_start, download_finish, click_install, "+
"install_finish, active, register, next_day_open, next_day_open_cost, next_day_open_rate, attribution_next_day_open_cnt,"+
" game_addiction, pay_count, in_app_uv, in_app_detail_uv, in_app_cart, in_app_pay, in_app_order, attribution_game_pay_7d_count,"+
" game_pay_count, total_play, valid_play, play_25_feed_break, play_50_feed_break, play_75_feed_break, play_100_feed_break, "+
"play_duration_sum, attribution_active_pay_intra_one_day_count, attribution_active_pay_intra_one_day_amount, gmt_modified AS timestamp").
Select(reportCommonFiled).
Where("customer_id = ?", customerId).
Where("is_delete = ?", 0)
......
......@@ -26,12 +26,7 @@ func (p *creativeRepo) List(ctx context.Context, customerId int64, req *biz.List
tableName = "ads_report_creative_hour"
}
db := p.data.db.Table(tableName).
Select("creative_id, advertise_id as ad_id, advertise_name as ad_name, campaign_id, campaign_name, advertiser_id, date_long AS stat_datetime, cost, `show`, click, `convert`, "+
"deep_convert, attribution_convert, attribution_deep_convert, download_start, download_finish, click_install, "+
"install_finish, active, register, next_day_open, next_day_open_cost, next_day_open_rate, attribution_next_day_open_cnt,"+
" game_addiction, pay_count, in_app_uv, in_app_detail_uv, in_app_cart, in_app_pay, in_app_order, attribution_game_pay_7d_count,"+
" game_pay_count, total_play, valid_play, play_25_feed_break, play_50_feed_break, play_75_feed_break, play_100_feed_break, "+
"play_duration_sum, attribution_active_pay_intra_one_day_count, attribution_active_pay_intra_one_day_amount, gmt_modified AS timestamp").
Select("creative_id, advertise_id AS ad_id, advertise_name AS ad_name, "+reportCommonFiled).
Where("customer_id = ?", customerId).
Where("is_delete = ?", 0)
......
package data
const reportCommonFiled = "campaign_id, campaign_name, advertiser_id, date_long AS stat_datetime, cost, `show`, click, `convert`, deep_convert, attribution_convert, attribution_deep_convert, download_start, download_finish, click_install, install_finish, active, register, next_day_open, next_day_open_cost, next_day_open_rate, attribution_next_day_open_cnt, game_addiction, pay_count, in_app_uv, in_app_detail_uv, in_app_cart, in_app_pay, in_app_order, attribution_game_pay_7d_count, game_pay_count, total_play, valid_play, play_25_feed_break, play_50_feed_break, play_75_feed_break, play_100_feed_break, play_duration_sum, attribution_active_pay_intra_one_day_count, attribution_active_pay_intra_one_day_amount, gmt_modified AS timestamp"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment