f7d86011c1
- 新增 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> --------- Co-authored-by: OuYingJun1024 <1034284404@qq.com> Reviewed-on: #54 Co-authored-by: ouzhou <ouzhou@wonderable.ai> Co-committed-by: ouzhou <ouzhou@wonderable.ai>
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
"""ad revenue report columns: app_env + our_code_id
|
|
|
|
给 ad_ecpm_record / ad_reward_record / ad_feed_reward_record 各加两列:
|
|
- app_env:我们的穿山甲应用环境(prod=傻瓜比价正式 / test=测试应用)
|
|
- our_code_id:我们在穿山甲后台配置的代码位 ID(104xxx,非底层 mediation rit)
|
|
|
|
供「广告收益报表」按 用户/日期/广告类型/应用/代码位 聚合 展示条数/收益/金币。
|
|
旧数据这两列为 NULL(报表里来源列留空),新数据由客户端上报/发奖时回填。
|
|
|
|
Revision ID: ad_revenue_report_cols
|
|
Revises: coupon_engage_per_package
|
|
Create Date: 2026-06-15
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision = "ad_revenue_report_cols"
|
|
down_revision = "coupon_engage_per_package"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
_TABLES = ("ad_ecpm_record", "ad_reward_record", "ad_feed_reward_record")
|
|
|
|
|
|
def upgrade() -> None:
|
|
for table in _TABLES:
|
|
op.add_column(table, sa.Column("app_env", sa.String(length=16), nullable=True))
|
|
op.add_column(table, sa.Column("our_code_id", sa.String(length=64), nullable=True))
|
|
|
|
|
|
def downgrade() -> None:
|
|
for table in _TABLES:
|
|
op.drop_column(table, "our_code_id")
|
|
op.drop_column(table, "app_env")
|