fix(management): drilldown行补channel字段——前端聊天路由判渠道用(契约冻结前补齐)

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-10 09:49:59 +08:00
parent 2b10c07fb7
commit 940762e7ff
2 changed files with 8 additions and 3 deletions
+3 -1
View File
@@ -396,7 +396,7 @@ async def lifecycle_customers(
) -> list[dict]:
"""drilldown cooling/dormant:该员工账号归属客户(delete_flag 过滤)+
msg_daily_stats friend 行全历史 → lifecycle.classify(as_of=窗口末日),
返回状态匹配行 {friend_id, nickname, last_day, state},按 last_day asc
返回状态匹配行 {friend_id, channel, nickname, last_day, state},按 last_day asc
(最陈旧在前)、friend_id asc 排序。
历史按 (channel, peer) 键控、跨 owner 合并——与批次A _lifecycle_daily
@@ -445,6 +445,7 @@ async def lifecycle_customers(
if state == want_state:
matches.append({
"friend_id": c.friend_id,
"channel": c.channel,
"nickname": c.friend_nickname or c.friend_remark or c.friend_id,
"last_day": last,
"state": state,
@@ -483,6 +484,7 @@ async def fr_fact_rows(
)).scalars().all()
items = [{
"day": f.day,
"channel": f.channel,
"owner_account_id": f.owner_account_id,
"peer_id": f.peer_id,
"thread_end_ts": f.thread_end_ts,