Add period-over-period trend table at top of report

build_data.py now also computes each buyer's total for the preceding
3-day window under identical rules (exclusions, attribution), exposed as
prev_total plus meta.prev_range. index.html renders it as the first
panel, with green/red deltas and a total row; the panel stays hidden if
no prior period exists.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
FANGKK
2026-09-07 23:42:03 +08:00
co-authored by Claude Opus 5
parent b33cfcf6cb
commit 88084ce5ff
3 changed files with 47 additions and 0 deletions
+6
View File
@@ -4,6 +4,7 @@
"source": "萌奇熊日报",
"generated_at": "2026-09-07",
"date_range": "2026/09/04-2026/09/06",
"prev_range": "2026/09/01-2026/09/03",
"note": "投放人以「投手」表 Media Buyer 列为准,@某某 已与某某合并计算;未填写投放人的 Adpingid 不计入;exclude.json 所列包名已排除。Package 后缀为该 Package 花费最高的投放地区,Adpingid 为该地区内花费最高的 Adping。"
},
"grand_total": 13199.6784,
@@ -13,6 +14,7 @@
"name": "黄政",
"@name": "黄政",
"total": 3782.5992,
"prev_total": 4004.0344,
"active_ids": 36,
"owned_ids": 140,
"pkgs": [
@@ -57,6 +59,7 @@
"name": "谭超",
"@name": "谭超",
"total": 3055.013,
"prev_total": 3188.919,
"active_ids": 24,
"owned_ids": 128,
"pkgs": [
@@ -101,6 +104,7 @@
"name": "周梓君",
"@name": "周梓君",
"total": 2402.8622,
"prev_total": 2022.3678,
"active_ids": 29,
"owned_ids": 121,
"pkgs": [
@@ -145,6 +149,7 @@
"name": "万科",
"@name": "万科",
"total": 2297.6288,
"prev_total": 2335.8325,
"active_ids": 24,
"owned_ids": 112,
"pkgs": [
@@ -189,6 +194,7 @@
"name": "詹涵粤",
"@name": "詹涵粤",
"total": 1661.5752,
"prev_total": 1798.7887,
"active_ids": 14,
"owned_ids": 146,
"pkgs": [