Neo
a045625d48
fix(backend): 后端日志走查发现 2 个 schema 不一致 bug
- coach_service.py:594 _build_task_groups SQL 查 biz.notes.is_pinned
但表无该字段 → UndefinedColumn 抛错 + 事务终止 + 级联 _build_notes
/ _build_history_months 全部失败(InFailedSqlTransaction)
修复:删除 is_pinned 列,pinned 降级 False(置顶功能未落库,
不影响核心备注展示)。
- customer_service.py:1088 _get_consumption_month_summary SQL 用错
3 个字段(从 v_dwd_assistant_service_log 复制粘贴未适配
v_dwd_settlement_head 字段名差异):
sh.tenant_member_id → sh.member_id
sh.is_delete = 0 → 删除(view 已过滤已撤销订单)
sh.settle_time → sh.create_time
→ 高频 UndefinedColumn,小程序 customer-records 月度 rechargeTotal
恒返回 0,consumption60D 恒返回 null。
走查覆盖(MCP):
- 小程序 customer-records 调 /api/xcx/customers/{id}/consumption-records
修前: rechargeTotal=0, consumption60D=null
修后: rechargeTotal=1009.08, consumption60D=7758.24, daysSinceVisit=31
visitCount=1, consumeTotal=384.02 全部 PASS
发现来源:tmp/20260505_backed_LOG.txt 后端日志 grep
ERROR/Traceback 反复出现 UndefinedColumn。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 11:59:30 +08:00
..
2026-05-05 11:52:40 +08:00
2026-02-19 08:35:13 +08:00
2026-04-06 00:03:48 +08:00
2026-05-04 02:30:19 +08:00
2026-05-04 02:30:19 +08:00
2026-03-09 01:19:21 +08:00
2026-05-05 11:59:30 +08:00
2026-05-05 11:59:30 +08:00
2026-05-04 02:30:19 +08:00
2026-04-06 00:03:48 +08:00
2026-04-06 00:03:48 +08:00
2026-05-04 02:30:19 +08:00
2026-04-06 00:03:48 +08:00
2026-04-20 06:32:07 +08:00
2026-05-04 02:30:19 +08:00
2026-04-06 00:03:48 +08:00
2026-05-05 03:01:48 +08:00
2026-04-06 00:03:48 +08:00
2026-04-06 00:03:48 +08:00
2026-05-04 02:30:19 +08:00
2026-05-04 02:30:19 +08:00
2026-05-04 02:30:19 +08:00
2026-04-06 00:03:48 +08:00
2026-04-20 06:32:07 +08:00
2026-05-04 02:30:19 +08:00
2026-04-06 00:03:48 +08:00