From 7edb4e241ca19ede6159936994b25f079b674e97 Mon Sep 17 00:00:00 2001 From: linkeyu Date: Wed, 22 Jul 2026 09:46:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=9A=E5=B9=BF?= =?UTF-8?q?=E5=91=8A=E6=94=B6=E7=9B=8A=E5=A2=9E=E5=8A=A0=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E4=B8=8E=E6=95=B0=E6=8D=AE=E8=8C=83=E5=9B=B4=E7=AD=9B=E9=80=89?= =?UTF-8?q?=20(#58)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 修改内容 - 广告收益页新增环境筛选,默认正式环境 - 新增数据范围筛选,默认业务代码位 - 查询时同步传递环境和收益范围,便于客户端与穿山甲同口径对账 - 更新收益口径说明 ## 本地验证 - TypeScript 检查通过 - Next.js 生产构建通过 - 本地页面已实测默认筛选及正式、测试、全部环境与代码位范围切换 ## 依赖 需配合服务端同名功能合并请求上线。 --------- Co-authored-by: linkeyu <798648091@qq.com> Reviewed-on: https://gitea.shaguabijia.com/WonderableAI/shaguabijia-admin-web/pulls/58 Co-authored-by: linkeyu Co-committed-by: linkeyu --- src/app/(main)/ad-revenue-report/page.tsx | 34 +++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/app/(main)/ad-revenue-report/page.tsx b/src/app/(main)/ad-revenue-report/page.tsx index a6eb426..1fe077b 100644 --- a/src/app/(main)/ad-revenue-report/page.tsx +++ b/src/app/(main)/ad-revenue-report/page.tsx @@ -300,6 +300,8 @@ export default function AdRevenueReportPage() { const { message } = App.useApp(); const [range, setRange] = useState<[Dayjs, Dayjs]>([dayjs().subtract(1, 'day'), dayjs().subtract(1, 'day')]); const [userId, setUserId] = useState(null); + const [appEnv, setAppEnv] = useState<'prod' | 'test' | 'all'>('prod'); + const [revenueScope, setRevenueScope] = useState<'business' | 'all'>('business'); const [adType, setAdType] = useState(); // 「场景」作为后端全局筛选(feed_scene):同时影响明细 / 合计 / 趋势,与「用户 / 类型」一致,点「查询」生效。 const [scene, setScene] = useState(); @@ -333,6 +335,8 @@ export default function AdRevenueReportPage() { date_from: from, date_to: to, user_id: userId ?? undefined, + app_env: appEnv === 'all' ? undefined : appEnv, + revenue_scope: revenueScope, ad_type: adType ?? undefined, feed_scene: scene ?? undefined, granularity: gran, @@ -374,7 +378,7 @@ export default function AdRevenueReportPage() { setLoading(false); } }, - [range, userId, adType, scene, granularity, limit, sortBy], + [range, userId, appEnv, revenueScope, adType, scene, granularity, limit, sortBy], ); useEffect(() => { @@ -620,7 +624,8 @@ export default function AdRevenueReportPage() {
核心指标里的「穿山甲后台收益(T+1)」来自穿山甲 GroMore 数据 API(后台结算口径,次日出数): 穿山甲预估收益=接口 revenue、收益API=各 ADN 回传更接近结算。穿山甲不提供分用户/类型/场景维度, - 故仅在全量视图(未按用户/类型/场景筛选)展示;逐条事件行仍是客户端预估,不受其影响。 + 故仅在可对账视图(未按用户/类型/场景筛选)展示;环境和数据范围会同时作用于客户端与穿山甲汇总。 + 默认“正式 + 业务代码位”用于同口径对账;切到“全部代码位”会包含广告测试等非业务曝光。 } > @@ -655,6 +660,31 @@ export default function AdRevenueReportPage() { style={{ width: 130 }} /> + + 环境 + + 类型