feat(customers): 发送/接收列改今日口径(对齐云客;本地消息表Asia/Shanghai今日聚合)

- CustomerOut 加 send_today/receive_today(路由赋值,非ORM列)
- /api/customers 每页一次 GROUP BY(owner IN 走复合索引前缀)
- 前端列优先今日值,无消息数据回退原raw字段;列名对齐云客「发送条数/接收条数」
- TDD:今日3发2收+昨日不计入+无消息客户0

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-22 14:39:17 +08:00
parent 00ae13b5c2
commit a290e39523
5 changed files with 88 additions and 5 deletions
+4
View File
@@ -25,6 +25,10 @@ class CustomerOut(BaseModel):
channel: str
owner_account_id: str | None = None
friend_nickname: str | None = None
# 今日发送/接收条数(本地消息表按 Asia/Shanghai 今日聚合,对齐云客口径;
# 非 ORM 列,由路由赋值,2026-08-22)
send_today: int | None = None
receive_today: int | None = None
friend_remark: str | None = None
real_name: str | None = None
phone: str | None = None