晓夏

北漂的女孩

Good Luck To You!

商品/店铺优惠券数据库设计

浏览量:412

CREATE TABLE `cc_coupon_temp` (

 `id` int(11) NOT NULL AUTO_INCREMENT,
 `shop_id` int(11) NOT NULL DEFAULT '0' COMMENT '店铺id  为0时,代表商城优惠券',
`range` enum('all','shop','shop_list','product','product_list','category') NOT NULL DEFAULT 'all' COMMENT 'all:全商城 shop:店铺优惠券 category:指定类目 product:指定商品',

`range_rule` text NOT NULL COMMENT '(rangeType:all)   {} (rangeType:shop)   {shop_id:8} (rangeType:product)   {product_id:100000052} (rangeType:product_list)   {product_list:[100000052,100000052]}',
 `type` enum('none','require_money') NOT NULL DEFAULT 'none' COMMENT 'none:无条件优惠券,require_money:有条件券',
 `type_rule` text NOT NULL COMMENT '(limitRule:none)   {} (limitRule:require_money)   {require_money:100.00}',
 `title` varchar(36) NOT NULL DEFAULT '' COMMENT '优惠券标题',
 `facevalue` float(6,2) NOT NULL COMMENT '优惠券面值',
 `start_time` int(11) NOT NULL COMMENT '开始时间',
 `end_time` int(11) NOT NULL COMMENT '结束时间',
 `max_num` int(8) NOT NULL COMMENT '最大发行量',
 `create_num` int(8) DEFAULT NULL COMMENT '已领取数量',
 `used_num` int(11) NOT NULL DEFAULT '0'  COMMENT '已使用的数量',,
 `receive_num` tinyint(4) NOT NULL COMMENT '每人限量的张数',
 `status` tinyint(2) DEFAULT '0' COMMENT '0 正在发行 1不可发放(未用)  2 时间过期   3 作废',
 `is_show` tinyint(2) DEFAULT '1' COMMENT '是否展示给买家  1 是  0 否',
 `act_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '活动类型:  0   无;1  平台其他 ;2  挖矿 ;3 第三方合作;4 大促活动;5 拉新活动;6兑换码兑换券;7 用户补偿;8 退款补贴;9 积分兑换券',
 `link` varchar(200) DEFAULT NULL COMMENT '跳转链接',
 `mtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后修改时间',
 `operaer` varchar(30) NOT NULL DEFAULT '' COMMENT '操作人',
 PRIMARY KEY (`id`),
 KEY `usestatus` (`id`,`status`),
 KEY `shop_id` (`shop_id`,`status`) USING BTREE,
 KEY `idx_act_type` (`act_type`),
 KEY `idx_endtime` (`end_time`) COMMENT '结束时间'
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='优惠券详情信息表'


CREATE TABLE `cc_shop_coupon_activity` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
 `shop_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '店铺id',
 `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商家用户id',
 `activity_name` varchar(30) NOT NULL DEFAULT '' COMMENT '活动标题',
 `template` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '优惠券模板',
 `price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '优惠券价格',
 `activity_start_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活动开始时间',
 `activity_end_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活动结束时间',
 `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态 0正常,1暂停,2已删除',
 `product_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '隐藏商品id',
 `coupon_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '隐藏优惠券id',
 `ctime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
 `mtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后修改时间',
 PRIMARY KEY (`id`),
 UNIQUE KEY `product_id` (`product_id`),
 KEY `idx_shop_id_status` (`shop_id`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=236 DEFAULT CHARSET=utf8 COMMENT='店铺优惠券秒杀活动表'



















神回复

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。