feat: 2026-04-15~04-20 累积变更基线 — 多主线合流
主线 1: rns1-customer-coach-api + 04-miniapp-core-business 后端实施
- 新增 GET /xcx/coaches/{id}/banner 轻量接口
- performance/records 加 coach_id 参数 + view_board_coach 权限分流
- coach/customer/performance/board/task 服务层重构
- fdw_queries 结算单粒度聚合 + consumption_summary 视图统一
- task_generator 回访宽限 72h + UPSERT 替代策略 + Step 5 保底清理
- recall_detector settle_type=3 双重限制 + 门店级 resolved
主线 2: 小程序权限分流 + 新增 coach-service-records 管理者视角业绩明细页
- perf-progress 共享模块去重 task-list/coach-detail 动画逻辑
- isScattered 散客标记端到端
- foodDetail/phoneFull/creator* 字段透传
主线 3: P19 指数回测框架 Phase 1+2
- 3 个指数表 stat_date 日快照模式
- 新增 DWS_INDEX_BACKFILL / DWS_TASK_SIMULATION 工具任务
- task_engine 升级 HTTP 实时 + 推演回测双模式
主线 4: Core 维度层启用
- 新增 CORE_DIM_SYNC 任务(DWD → core 4 维度表)
- 修复 app 视图空查询问题
主线 5: member_project_tag 改为 LAST_30_VISITS 消费次数窗口
主线 6: 2 个迁移 SQL 已执行(stat_date + member_project_tag 新窗口)
- schema 基线与 DDL 快照同步
主线 7: 开发机路径迁移 C:\NeoZQYY → C:\Project\NeoZQYY(约 95% 改动量)
附带: 新建运维脚本(churned_customer_report / simulate_historical_tasks /
backfill_index_snapshots)+ tools/task-analysis/ 任务分析工具
合计 157 文件。未包含中间产物(tmp/ .playwright-mcp/ inspect-* excel/sheet 分析 txt)。
审计记录见下一个 commit。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
-- =============================================================================
|
||||
-- etl_feiqiu / app(RLS 视图层)
|
||||
-- 生成日期:2026-04-06
|
||||
-- 生成日期:2026-04-12
|
||||
-- 来源:测试库(通过脚本自动导出)
|
||||
-- =============================================================================
|
||||
|
||||
@@ -439,10 +439,8 @@ SELECT table_fee_log_id,
|
||||
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
|
||||
;
|
||||
|
||||
-- CHANGE 2026-04-08 | DISTINCT ON 只取每对 (assistant, member) 最新快照
|
||||
CREATE OR REPLACE VIEW app.v_dws_assistant_customer_stats AS
|
||||
SELECT DISTINCT ON (assistant_id, member_id)
|
||||
id,
|
||||
SELECT DISTINCT ON (assistant_id, member_id) id,
|
||||
site_id,
|
||||
tenant_id,
|
||||
assistant_id,
|
||||
@@ -946,7 +944,7 @@ SELECT intimacy_id,
|
||||
;
|
||||
|
||||
CREATE OR REPLACE VIEW app.v_dws_member_assistant_relation_index AS
|
||||
SELECT relation_id,
|
||||
SELECT DISTINCT ON (member_id, assistant_id) relation_id,
|
||||
site_id,
|
||||
tenant_id,
|
||||
member_id,
|
||||
@@ -974,15 +972,21 @@ SELECT relation_id,
|
||||
ml_display,
|
||||
calc_time,
|
||||
created_at,
|
||||
updated_at
|
||||
updated_at,
|
||||
recall_created_total,
|
||||
recall_completed_total,
|
||||
follow_up_created_total,
|
||||
follow_up_completed_total,
|
||||
total_created,
|
||||
total_completed,
|
||||
stat_date
|
||||
FROM dws.dws_member_assistant_relation_index
|
||||
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
|
||||
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint)
|
||||
ORDER BY member_id, assistant_id, stat_date DESC;
|
||||
;
|
||||
|
||||
-- CHANGE 2026-04-08 | DISTINCT ON 只取每个会员最新快照,避免多 stat_date 行膨胀
|
||||
CREATE OR REPLACE VIEW app.v_dws_member_consumption_summary AS
|
||||
SELECT DISTINCT ON (member_id)
|
||||
id,
|
||||
SELECT DISTINCT ON (member_id) id,
|
||||
site_id,
|
||||
tenant_id,
|
||||
member_id,
|
||||
@@ -1034,7 +1038,7 @@ SELECT DISTINCT ON (member_id)
|
||||
;
|
||||
|
||||
CREATE OR REPLACE VIEW app.v_dws_member_newconv_index AS
|
||||
SELECT newconv_id,
|
||||
SELECT DISTINCT ON (member_id) newconv_id,
|
||||
site_id,
|
||||
tenant_id,
|
||||
member_id,
|
||||
@@ -1071,9 +1075,11 @@ SELECT newconv_id,
|
||||
calc_time,
|
||||
calc_version,
|
||||
created_at,
|
||||
updated_at
|
||||
updated_at,
|
||||
stat_date
|
||||
FROM dws.dws_member_newconv_index
|
||||
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
|
||||
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint)
|
||||
ORDER BY member_id, stat_date DESC;
|
||||
;
|
||||
|
||||
CREATE OR REPLACE VIEW app.v_dws_member_project_tag AS
|
||||
@@ -1160,7 +1166,7 @@ SELECT id,
|
||||
;
|
||||
|
||||
CREATE OR REPLACE VIEW app.v_dws_member_winback_index AS
|
||||
SELECT winback_id,
|
||||
SELECT DISTINCT ON (member_id) winback_id,
|
||||
site_id,
|
||||
tenant_id,
|
||||
member_id,
|
||||
@@ -1195,9 +1201,11 @@ SELECT winback_id,
|
||||
updated_at,
|
||||
overdue_cdf_p,
|
||||
ideal_interval_days,
|
||||
ideal_next_visit_date
|
||||
ideal_next_visit_date,
|
||||
stat_date
|
||||
FROM dws.dws_member_winback_index
|
||||
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
|
||||
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint)
|
||||
ORDER BY member_id, stat_date DESC;
|
||||
;
|
||||
|
||||
CREATE OR REPLACE VIEW app.v_dws_order_summary AS
|
||||
|
||||
Reference in New Issue
Block a user