CREATE TABLE `shop_store_activity_base_1` (
                                              `activity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '活动编号',
                                              `store_id` int unsigned NOT NULL DEFAULT '0' COMMENT '店铺编号',
                                              `user_id` int unsigned NOT NULL DEFAULT '0' COMMENT '用户编号',
                                              `activity_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '活动名称',
                                              `activity_title` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '活动标题',
                                              `activity_remark` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '活动说明',
                                              `activity_combo_id` int unsigned NOT NULL DEFAULT '0' COMMENT '套餐编号',
                                              `activity_type_id` int unsigned NOT NULL DEFAULT '0' COMMENT '活动类型',
                                              `activity_starttime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '活动开始时间',
                                              `activity_endtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '活动结束时间',
                                              `activity_state` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '活动状态(ENUM):0-未开启;1-正常;2-已结束;3-管理员关闭;4-商家关闭',
                                              `activity_rule` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT '活动规则(json):不检索{rule_id:{}, rule_id:{}},统一解析规则{"requirement":{"buy":{"item":[1,2,3],"subtotal":"通过计算修正满足的条件"}},"rule":[{"total":100,"max_num":1,"item":{"1":1,"1200":3}},{"total":200,"max_num":1,"item":{"1":1,"1200":3}}]}',
                                              `activity_type` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '参与类型(ENUM):1-免费参与;2-积分参与;3-购买参与;4-分享参与',
                                              `activity_order` tinyint unsigned NOT NULL DEFAULT '50' COMMENT '排序',
                                              `activity_is_finish` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '活动是否完成(ENUM):0-未完成;1-已完成;2-已解散(目前用于团购)',
                                              `item_id` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '单品优惠商品编号DOT',
                                              `subsite_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '0' COMMENT '分站ID',
                                              `version` int unsigned NOT NULL DEFAULT '0' COMMENT '版本',
                                              `activity_on_is_off` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '活动是否线上或线下:0:线上,1:线下',
                                              `activity_share_num` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '活动分享次数',
                                              `activity_use_level` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '活动使用等级(DOT)',
                                              `activity_releasetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '发布时间',
                                              `flow_no` varchar(255) DEFAULT NULL COMMENT '思迅活动id',
                                              `cut_hour` int DEFAULT '72' COMMENT '在活动时间范围内，用户砍价允许的天数',
                                              `product_count` int DEFAULT '5' COMMENT '参加活动商品的总数量',
                                              PRIMARY KEY (`activity_id`) USING BTREE,
                                              KEY `store_id` (`store_id`,`activity_state`) USING BTREE,
                                              KEY `activity_type_id` (`activity_type_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2390 DEFAULT CHARSET=utf8mb3 COMMENT='活动表-通过插件实现\r\n当为拼团是activity_rule中的group_remain_quantity用于标识拼团剩余需要人数，如果用户登录了，需要查询出activity_groupbooking中参与该团的剩余情况';
insert into shop_store_activity_base_1 select * from shop_store_activity_base;
drop table shop_store_activity_base;
CREATE table shop_store_activity_base as select * from  shop_store_activity_base_1;
drop table shop_store_activity_base_1;