多店铺需求

This commit is contained in:
Tankaikai
2025-04-09 15:32:25 +08:00
parent 3a5f65e8ec
commit ca8d49bac7
3 changed files with 32 additions and 74 deletions

View File

@@ -2,12 +2,4 @@
-- tb_shop_user表扩展字段
-- ----------------------------
ALTER TABLE `tb_shop_user`
ADD COLUMN `is_merged_to_head` tinyint NULL DEFAULT 0 COMMENT '是否已经合并数据到主店 1-是 0-否 默认0',
ADD COLUMN `merged_users` text NULL COMMENT '已经合并过来的用户信息jsonArray格式,[{\"id\":1,\"shopId\":2,...},{\"id\":1,\"shopId\":2,...}]',
ADD COLUMN `all_shop_ids` varchar(1200) NULL COMMENT '适用门店id集合逗号分隔例如0,1,2,3,...查询的时候 all_shop_ids like \'%,1,%\';';
-- ----------------------------
-- 处理历史数据
-- ----------------------------
update tb_shop_user set is_merged_to_head = 0;
update tb_shop_user set all_shop_ids = concat('0,', shop_id, ',');
ADD COLUMN `merged_users` text NULL COMMENT '已经合并过来的用户信息jsonArray格式,[{\"id\":1,\"shopId\":2,...},{\"id\":1,\"shopId\":2,...}]';