多店铺需求

This commit is contained in:
Tankaikai
2025-04-08 14:56:23 +08:00
parent c424f3613f
commit c4cdc83ec3
8 changed files with 241 additions and 9 deletions

View File

@@ -0,0 +1,13 @@
-- ----------------------------
-- 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, ',');