|
|
@@ -90,7 +90,6 @@ CREATE TABLE IF NOT EXISTS tasks (
|
|
|
points_expire_days INT DEFAULT 0 COMMENT '积分有效期天数',
|
|
|
dimension_code VARCHAR(20) COMMENT '五维维度: body/mind/wisdom/action/wealth',
|
|
|
dimension_weights JSON COMMENT '五维权重: {"body":0,"mind":0,"wisdom":0,"action":0,"wealth":0}',
|
|
|
- member_only TINYINT DEFAULT 0 COMMENT '1=会员任务(方案/套餐生成),执行需会员; 0=普通任务可免费执行',
|
|
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
|
INDEX idx_child_id_deadline (child_id, deadline),
|
|
|
@@ -640,8 +639,6 @@ CREATE TABLE IF NOT EXISTS package_orders (
|
|
|
transaction_id VARCHAR(64) COMMENT '微信支付订单号',
|
|
|
paid_at DATETIME COMMENT '支付时间',
|
|
|
notify_data TEXT COMMENT '支付回调数据',
|
|
|
- logistics_status VARCHAR(20) DEFAULT 'none' COMMENT '物流状态: none/kit_shipped/kit_received/sample_shipped/sample_received',
|
|
|
- tracking_no VARCHAR(100) DEFAULT '' COMMENT '快递单号',
|
|
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
|
INDEX idx_user_id (user_id),
|
|
|
@@ -4835,73 +4832,3 @@ INSERT IGNORE INTO admin_menu (parent_id, name, path, icon, sort_order, perm, co
|
|
|
(0, '系统配置', NULL, 'el-icon-setting', 90, 'system:config', NULL, 1),
|
|
|
(14, '菜单管理', '/menu-manage', 'el-icon-menu', 1, 'system:menu', 'admin/MenuManage', 1),
|
|
|
(14, '系统配置', '/sys-config', 'el-icon-setting', 2, 'system:config', 'admin/SysConfig', 1);
|
|
|
-
|
|
|
-<<<<<<< Updated upstream
|
|
|
--- =============================================
|
|
|
--- 改版v1: 需求驱动·逐步解锁(问题域/用户意图/站内通知)
|
|
|
--- =============================================
|
|
|
-
|
|
|
-CREATE TABLE IF NOT EXISTS problem_domains (
|
|
|
- id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
|
|
- code VARCHAR(50) NOT NULL COMMENT '唯一编码: weight_loss/sleep/constipation',
|
|
|
- name VARCHAR(50) NOT NULL COMMENT '名称: 减肥/睡眠/便秘',
|
|
|
- icon VARCHAR(255) DEFAULT '' COMMENT '图标',
|
|
|
- description VARCHAR(500) DEFAULT '' COMMENT '一句话描述',
|
|
|
- flow_intro_json TEXT COMMENT '服务流程介绍(7步) JSON',
|
|
|
- survey_template_id BIGINT DEFAULT NULL COMMENT '专项调研问卷模板ID(SurveyTemplate.id)',
|
|
|
- content_tags VARCHAR(500) DEFAULT '' COMMENT '内容标签,逗号分隔(过滤文章/知识库)',
|
|
|
- recommended_product_ids VARCHAR(500) DEFAULT '' COMMENT '推荐产品ID,逗号分隔(Product.id)',
|
|
|
- task_template_package_ids VARCHAR(500) DEFAULT '' COMMENT '套餐绑定的任务模板包ID(TaskTemplatePackage.id)',
|
|
|
- reward_cf_value INT DEFAULT 0 COMMENT '全部完成奖励CF值',
|
|
|
- status TINYINT DEFAULT 1 COMMENT '1启用 0停用',
|
|
|
- sort_order INT DEFAULT 0,
|
|
|
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
|
- updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
|
- UNIQUE KEY uk_code (code)
|
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='问题域定义(改版v1)';
|
|
|
-
|
|
|
-CREATE TABLE IF NOT EXISTS user_intents (
|
|
|
- id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
|
|
- user_id BIGINT NOT NULL COMMENT '用户ID',
|
|
|
- intent_type VARCHAR(20) DEFAULT '' COMMENT 'A/B/C 用户类型',
|
|
|
- problem_domain_code VARCHAR(50) DEFAULT '' COMMENT '问题域编码(仅C类)',
|
|
|
- journey_stage INT DEFAULT 0 COMMENT '旅程阶段 0-7',
|
|
|
- stage_updated_at DATETIME DEFAULT NULL COMMENT '最近阶段变化时间',
|
|
|
- survey_template_id BIGINT DEFAULT NULL COMMENT '最近作答问卷模板ID',
|
|
|
- survey_submitted_at DATETIME DEFAULT NULL COMMENT '最近问卷提交时间',
|
|
|
- survey_result_json TEXT COMMENT '问卷答案→推荐结果快照',
|
|
|
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
|
- updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
|
- UNIQUE KEY uk_user (user_id)
|
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户意图与服务旅程(改版v1)';
|
|
|
-
|
|
|
-CREATE TABLE IF NOT EXISTS user_notifications (
|
|
|
- id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
|
|
- user_id BIGINT NOT NULL COMMENT '接收用户ID',
|
|
|
- type VARCHAR(30) DEFAULT 'report_ready' COMMENT 'report_ready/reward_granted/logistics/system',
|
|
|
- title VARCHAR(200) NOT NULL,
|
|
|
- content VARCHAR(1000) DEFAULT '',
|
|
|
- ref_type VARCHAR(30) DEFAULT '' COMMENT '关联对象类型: report/package/task',
|
|
|
- ref_id BIGINT DEFAULT NULL COMMENT '关联对象ID',
|
|
|
- is_read TINYINT DEFAULT 0,
|
|
|
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
|
- INDEX idx_user_read (user_id, is_read)
|
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='站内通知(改版v1)';
|
|
|
-=======
|
|
|
--- 当前状态调研-健康现状档案(迁移231)
|
|
|
-CREATE TABLE IF NOT EXISTS health_status (
|
|
|
- id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
|
|
- user_id BIGINT NOT NULL COMMENT '所属账号(一个账号一份)',
|
|
|
- height_cm DECIMAL(5,1) DEFAULT NULL COMMENT '身高(cm)',
|
|
|
- weight_kg DECIMAL(5,1) DEFAULT NULL COMMENT '体重(kg)',
|
|
|
- blood_pressure VARCHAR(20) DEFAULT NULL COMMENT '血压,如 120/80',
|
|
|
- blood_glucose DECIMAL(4,1) DEFAULT NULL COMMENT '空腹血糖(mmol/L)',
|
|
|
- blood_lipids JSON DEFAULT NULL COMMENT '血脂 [{name,value,unit,note}]',
|
|
|
- disease_history JSON DEFAULT NULL COMMENT '疾病史 [{name,note}]',
|
|
|
- medications JSON DEFAULT NULL COMMENT '在服药物/治疗 [{name,note}]',
|
|
|
- notes VARCHAR(500) DEFAULT NULL COMMENT '其他补充说明',
|
|
|
- filled_at DATETIME DEFAULT NULL COMMENT '首次填写时间',
|
|
|
- updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
|
|
- UNIQUE KEY uk_user (user_id)
|
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='当前状态调研-健康现状档案';
|
|
|
->>>>>>> Stashed changes
|