|
|
/*
|
|
|
0元购
|
|
|
@author: 陈峰 <feng.chen@yoho.cn>
|
|
|
@date: 2018-07-19 13:48:13
|
|
|
*/
|
|
|
#注意:GO;分割执行块
|
|
|
|
|
|
#抽奖商品
|
|
|
CREATE TABLE IF NOT EXISTS act_prize_product (
|
|
|
`id` int(8) NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
|
`act_id` int(8) NOT NULL DEFAULT 0,
|
|
|
`name` varchar(200) NOT NULL DEFAULT '' comment '商品名称',
|
|
|
`price` decimal DEFAULT 0 comment '商品价格',
|
|
|
`status` TINYINT DEFAULT 0 comment '商品状态 0:关闭 1:活动开始 2:已开奖',
|
|
|
`start_time` int(10) NOT NULL DEFAULT 0 comment '活动开始时间',
|
|
|
`end_time` int(10) NOT NULL DEFAULT 0 comment '活动结束时间',
|
|
|
`limit` int(8) DEFAULT 0 comment '活动所需开奖人数',
|
|
|
`sort` int(8) DEFAULT 0 comment '排序,数值越大越靠前',
|
|
|
`cover_img` varchar(200) NOT NULL DEFAULT '',
|
|
|
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
|
) DEFAULT CHARSET=utf8;
|
|
|
GO;
|
|
|
|
|
|
|
|
|
#抽奖商品内容
|
|
|
CREATE TABLE IF NOT EXISTS act_prize_product_content (
|
|
|
`id` int(8) NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
|
`act_id` int(8) NOT NULL DEFAULT 0,
|
|
|
`act_prize_id` int(8) NOT NULL DEFAULT 0,
|
|
|
`floor_type` TINYINT DEFAULT 0 comment '楼层类型 1:文本 2:图片 3:视频地址',
|
|
|
`content` text comment '文本内容、图片地址、视频地址',
|
|
|
`sort` int(8) DEFAULT 0 comment '排序,数值越大越靠前'
|
|
|
) DEFAULT CHARSET=utf8;
|
|
|
GO;
|
|
|
|
|
|
#抽奖码
|
|
|
CREATE TABLE IF NOT EXISTS act_prize_product_user (
|
|
|
`id` int(8) NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
|
`act_id` int(8) NOT NULL DEFAULT 0,
|
|
|
`act_prize_id` int(8) NOT NULL DEFAULT 0,
|
|
|
`uid` int(8) NOT NULL DEFAULT 0,
|
|
|
`union_id` VARCHAR(50) DEFAULT '' comment '微信union_id',
|
|
|
`prize_code` varchar(20) DEFAULT '' comment '抽奖码8位随机字母加数字(大写),且同一个大活动不重复',
|
|
|
`is_share_take` TINYINT DEFAULT 0 comment '是分享出去而得到的抽奖码',
|
|
|
`share_uid` int(8) NOT NULL DEFAULT 0 comment '分享出去对方的uid',
|
|
|
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
|
) DEFAULT CHARSET=utf8;
|
|
|
GO; |
...
|
...
|
|