feat: 迁移渠道画像累计指标和玩家付费分层

This commit is contained in:
Yvan
2026-11-03 23:50:05 +08:00
parent 0de822f121
commit f5b7ce21b9
38 changed files with 1424 additions and 37 deletions
+10 -7
View File
@@ -128,13 +128,16 @@ func (r *channelRepo) Games(ctx context.Context, scope business.ChannelGameScope
return db.Table(table+" r").Where("r.source_db = ? AND r.game_id > 0 AND r.dedup_mode = ?", scope.Root.SourceDB, dedup).Where("EXISTS (?)", channelGameTree(db, scope).Select("1").Where("p.id=r.promote_id AND p.source_db=r.source_db"))
}
// 累计起点按当前人数口径的日汇总最早日期决定,与原画像查询一致。
var minimum struct{ FirstDate *string }
if err := query("tab_sw_report_day", mode).Select("CAST(MIN(r.stat_date) AS CHAR) AS first_date").Scan(&minimum).Error; err != nil {
return nil, business.ErrStorage
}
begin := scope.EndDate
if minimum.FirstDate != nil && *minimum.FirstDate != "" {
begin = *minimum.FirstDate
begin := scope.BeginDate
if begin == "" {
var minimum struct{ FirstDate *string }
if err := query("tab_sw_report_day", mode).Select("CAST(MIN(r.stat_date) AS CHAR) AS first_date").Scan(&minimum).Error; err != nil {
return nil, business.ErrStorage
}
begin = scope.EndDate
if minimum.FirstDate != nil && *minimum.FirstDate != "" {
begin = *minimum.FirstDate
}
}
byID := map[uint64]*business.ChannelGame{}
for _, id := range ids {