feat(ad-revenue): admin 广告收益报表(按 用户/日期/类型/应用/代码位 聚合) #54

Merged
marco merged 2 commits from feat/ad-revenue-report into main 2026-06-15 23:13:15 +08:00

2 Commits

Author SHA1 Message Date
OuYingJun1024 3ac58c1670 feat(ad): 记录不发金币的原因(closed_early / too_short)
让广告收益报表能呈现「有展示、没发金币」的原因:
- grant_feed_reward 改整场结算:aborted→closed_early、整场总时长<10s→too_short(均 coin=0)
- 新增 record_reward_noshow + POST /api/v1/ad/reward-noshow(激励视频提前关留痕;
  同 ad_session_id 已 granted 则跳过,防与 S2S 发奖重复)
- feed-reward 加 aborted 入参
- 文档:feed-reward / 两张表 status 取值、新增 ad-reward-noshow、README 索引
- alembic: 合并 ad_revenue_report_cols 与 store_mapping_tb_dl_invalid 双 head(空迁移)

报表复算无需改(非 granted 状态走 else 分支 expected=0 自动归类)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 22:41:41 +08:00
OuYingJun1024 bebd694fb5 feat(ad-revenue): admin 广告收益报表(按 用户/日期/类型/应用/代码位 聚合)
- 新增 GET /admin/api/ad-revenue-report:展示条数/收益 + 复用金币审计逐条复算做发奖对账
- ad_ecpm/ad_reward/ad_feed_reward 各加 app_env + our_code_id 两列(alembic 迁移)
- ecpm-report / feed-reward 接收并落库 app_env/our_code_id;激励发奖按 ad_session_id 回填
- ad_audit 抽出 audit_rows,报表与逐条审计复用同一复算口径
- 组级 matched 改「组内逐条全一致」,避免应发和==实发和的互相抵消掩盖错误
- list_feedbacks 改 offset 分页并返回 total(配合 admin 页码分页)
- 反馈正文上限 _CONTENT_MAX 2000→200
- 文档:新增 admin-ad-revenue-report,更新 ecpm/feed-reward/feedback 及对应 db docs

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 21:55:34 +08:00