MP-3 customer-detail coachTasks.lastService 业务日上界裁剪:
- apps/backend/app/services/customer_service.py
- import as_runtime_today_param 从 late import 提至模块顶部
- _build_coach_tasks 开头取 ref_date,供两段 SQL 共用
- 第一条直查 biz.coach_tasks 加 `AND updated_at < (%s::date + INTERVAL '1 day')::timestamptz`
- 删除原方法内重复 ref_date 调用
- 业务影响:sandbox=2026-04-20 时,customer-detail 的"上次服务"
时间不再展示 sandbox 业务日之后的助教任务更新(沙箱不读未来)
- 测试:apps/backend/tests/test_customer_detail_mp3_lastservice.py
本地通过,因 .gitignore:71 不入仓(同 T1 / af02446 处理方式)
MP-5 coach-service-records 接入 getBusinessClock:
- apps/miniprogram/miniprogram/pages/coach-service-records/coach-service-records.ts
- import getBusinessClock + data 加 clockYear/clockMonth/clockDay 字段
- onLoad 改 async,await getBusinessClock() 取 business_year/month/date
- loadData / switchMonth 4 处 new Date() → clockYear/Month/Day
- 业务影响:sandbox=2026-04-20 时,coach-service-records 默认显示
"2026 年 4 月"业绩(而非 today 月),canGoNext=false 阻止翻到 5 月,
"前 5 日预估金额"规则按 sandbox business_date 判断
双口径验证(weixin-devtools-mcp + DB 直查):
- MP-3 4a live: lastService 最大 04-19(无未来时间)
- MP-3 4b sandbox=4-20: 5-01 任务 task_id=8348/8347 完全消失
- MP-5 4a live: clockYear/Month/Day=2026/5/5,monthLabel="2026年5月"
- MP-5 4b sandbox=4-20: monthLabel="2026年4月" + 35 笔/¥4,657
first group=2026-04-20(后端 SQL 上界裁剪生效)
审计:
- docs/audit/changes/2026-05-05__wave1_f1_5b_mp3_lastservice_upper_bound.md
- docs/audit/changes/2026-05-05__wave1_f1_5b_mp5_coach_service_records_clock.md
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
apps/
作用说明
应用项目顶层目录,存放所有可独立部署/运行的子项目。当前包含 ETL Connector、FastAPI 后端、微信小程序前端,以及预留的管理后台。
内部结构
etl/pipelines/feiqiu/— 飞球 Connector(数据源连接器,抽取→清洗→汇总全流程)backend/— FastAPI 后端(小程序 API、权限、审批)miniprogram/— 微信小程序前端(Donut + TDesign)admin-web/— 管理后台(预留,暂未实施)mcp-server/— MCP Server(为百炼 AI 应用提供 PostgreSQL 只读查询)
Roadmap
- 新增更多 Connector 时,在
etl/pipelines/下按平台名创建子目录 admin-web/待产品需求确认后启动