Show Adpingid counts per buyer in 投手明细

build_data.py now emits active_ids (Adpingids with spend in the window)
and owned_ids (Adpingids assigned to the buyer, exclusions removed).
active_ids sums to the 覆盖 Adpingid 数 card.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
FANGKK
2026-08-27 14:31:45 +08:00
co-authored by Claude Opus 5
parent d980690ff2
commit 06f701699e
3 changed files with 15 additions and 1 deletions
+4
View File
@@ -33,6 +33,8 @@ for r in wb['投手'].iter_rows(min_row=2, values_only=True):
continue
amap[k] = b.lstrip('@').strip()
owned = collections.Counter(amap.values()) # 每位投手名下的 Adpingid 数(已扣除排除包名)
# --- 平台消耗统计 ---
rows = []
for r in wb['平台消耗统计'].iter_rows(min_row=2, values_only=True):
@@ -73,6 +75,8 @@ for b, pk in buyers.items():
out.append({
"name": b, "@name": b,
"total": round(sum(pk.values()), 4),
"active_ids": len(ids[b]), # 本周期内有消耗的 Adpingid 数
"owned_ids": owned[b], # 名下负责的 Adpingid 总数
"pkgs": [{"pkg": k, "spend": round(v, 4)}
for k, v in sorted(pk.items(), key=lambda x: -x[1])[:5]],
})