Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4f43450afa |
@@ -661,11 +661,17 @@ export default function AdRevenueReportPage() {
|
||||
: data.date_from
|
||||
: `${data.date_from} ~ ${data.date_to}`;
|
||||
|
||||
// 第二行大盘「分广告类型」:draw / 激励视频 各自 收益 / eCPM / 展示条数;eCPM = 收益÷展示×1000。
|
||||
// eCPM 优先使用后端按真实展示加权的经营分类口径;兼容旧后端时才用收益÷展示数回退。
|
||||
const drawStat = data?.type_stats?.draw;
|
||||
const rvStat = data?.type_stats?.reward_video;
|
||||
const withdrawalVideoStat = data?.type_stats?.withdrawal_video;
|
||||
const drawEcpmStat = data?.category_stats?.draw ?? drawStat;
|
||||
const videoEcpmStat = data?.category_stats?.video ?? {
|
||||
impressions: (rvStat?.impressions ?? 0) + (withdrawalVideoStat?.impressions ?? 0),
|
||||
revenue_yuan: (rvStat?.revenue_yuan ?? 0) + (withdrawalVideoStat?.revenue_yuan ?? 0),
|
||||
};
|
||||
const ecpmOf = (s?: AdRevenueTypeStat) =>
|
||||
s && s.impressions > 0 ? (s.revenue_yuan / s.impressions) * 1000 : 0;
|
||||
s?.ecpm_yuan ?? (s && s.impressions > 0 ? (s.revenue_yuan / s.impressions) * 1000 : 0);
|
||||
|
||||
// 明细直接用后端返回的当前页 items(「场景」已由后端 feed_scene 全局过滤,前端不再二次筛)。
|
||||
const items = data?.items ?? [];
|
||||
@@ -981,7 +987,7 @@ export default function AdRevenueReportPage() {
|
||||
<Statistic title="Draw 信息流收益(元)" value={drawStat?.revenue_yuan ?? 0} precision={4} />
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Statistic title="Draw 信息流 eCPM(元/千次)" value={ecpmOf(drawStat)} precision={2} />
|
||||
<Statistic title="Draw 信息流 eCPM(元/千次)" value={ecpmOf(drawEcpmStat)} precision={2} />
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Statistic title="Draw 信息流条数" value={drawStat?.impressions ?? 0} />
|
||||
@@ -990,7 +996,7 @@ export default function AdRevenueReportPage() {
|
||||
<Statistic title="看视频收益(元)" value={rvStat?.revenue_yuan ?? 0} precision={4} />
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Statistic title="看视频 eCPM(元/千次)" value={ecpmOf(rvStat)} precision={2} />
|
||||
<Statistic title="看视频 eCPM(元/千次)" value={ecpmOf(videoEcpmStat)} precision={2} />
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Statistic title="看视频条数" value={rvStat?.impressions ?? 0} />
|
||||
|
||||
@@ -568,6 +568,7 @@ export interface AdRevenueHourly {
|
||||
export interface AdRevenueTypeStat {
|
||||
impressions: number; // 该类型展示条数合计
|
||||
revenue_yuan: number; // 该类型预估收益合计(元)
|
||||
ecpm_yuan?: number; // 按真实展示次数加权的 SDK eCPM(元/千次)
|
||||
}
|
||||
|
||||
// 广告收益报表:一次广告事件(逐条一行)。激励视频展示+发奖按 ad_session_id 合并;信息流展示/发奖各自成行。
|
||||
@@ -607,6 +608,7 @@ export interface AdRevenueReport {
|
||||
daily: AdRevenueDaily[]; // 按日期汇总序列(全量,供按天趋势图)
|
||||
hourly: AdRevenueHourly[]; // 按小时汇总序列(全量,供按小时趋势图;按天查询时为空)
|
||||
type_stats: Record<string, AdRevenueTypeStat>; // 按广告类型小计;前端取 draw / reward_video
|
||||
category_stats?: Record<string, AdRevenueTypeStat>; // draw=draw+历史feed;video=福利视频+提现视频
|
||||
// 按信息流场景小计(comparison/coupon/welfare;全量,不受分页截断)。数据大盘「领券广告/比价广告」卡
|
||||
// 优先读它:2026-07-02 后端起 items 不再含信息流逐条展示行(唯一带收益+场景的行),按 items 现算恒 0。
|
||||
// 可选(`?.` 探测)以兼容未升级后端,缺失时回退 items 现算。
|
||||
|
||||
Reference in New Issue
Block a user