商品表 goods
CREATE TABLE `goods` (
? `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '商品ID',
? `goods_name` varchar(16) DEFAULT NULL COMMENT '商品名稱',
? `goods_title` varchar(64) DEFAULT NULL COMMENT '商品標(biāo)題',
? `goods_img` varchar(64) DEFAULT NULL? COMMENT '商品圖片',
? `goods_detail` longtext COMMENT '商品的詳情介紹',
? `goods_price` decimal(10,2) DEFAULT `0.00` COMMENT? '商品價(jià)格',
? `goods_stock` int(11) DEFAULT '0' COMMENT '商品庫存,-1表示沒有限制',
? PRIMARY KEY(`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8
秒殺商品表miaosha_goods
CREATE? TABLE `miaosha_goods` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '秒殺的商品表',
`goods_id` bigint(20) DEFAULT NULL COMMENT '商品id',
`miaosha_price` decimal(10,2) DEFAULT '0.00' COMMENT? '秒殺價(jià)',
`stock_count` int(11) DEFAULT? NULL COMMENT '庫存數(shù)量',
`start_date` datetime DEFAULT NULL COMMENT '秒殺開始時(shí)間',
`end_date` datetime DEFAULT NULL COMMENT '秒殺結(jié)束時(shí)間',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT? CHARSET=utf8
訂單表order_info
CREATE TABLE `order_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) DEFAULT NULL COMMENT '用戶ID',
`goods_id` bigint(20) DEFAULT? NULL COMMENT '商品ID',
`delivery_addr_id` bigint(20) DEFAULT NULL COMMENT '收貨地址ID',
`goods_name` varchar(16) DEFAULT NULL COMMENT '冗余過來的商品名稱',
`goods_count` int(11) DEFAULT '0' COMMENT '商品數(shù)量',
`goods_price` decimal(10,2) DEFAULT '0.00' COMMENT '商品單價(jià)',
`order_channel` tinyint(4) DEFAULT '0' COMMENT '1pc,2android,3ios',
`status` tinyint(4) DEFAULT '0' COMMENT '訂單狀態(tài):0新建未支付,1已支付花吟,2已發(fā)貨爽茴,3已收貨,4已退款兢榨,5已完成',
`create_date` datetime DEFAULT? NULL COMMENT? '訂單的創(chuàng)建時(shí)間',
`pay_date` datetime DEFAULT NULL? COMMENT '支付時(shí)間',
PRIMARY KEY(`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8
miaosha_order
CREATE TABLE `miaosha_order` (
`id`? bigint(20) ?NOT NULL AUTO_INCREMENT,
`user_id`? bigint(20) ?DEFAULT NULL ?COMMENT? '用戶ID',
`order_id`? bigint(20) ?DEFAULT NULL ?COMMENT? '訂單ID',
`goods_id`? bigint(20) ?DEFAULT NULL ?COMMENT '商品ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8
用戶表miaosha_user
CREATE TABLE `miaosha_user` (
`id` bigint(20) NOT NULL COMMENT '用戶ID嗅榕,手機(jī)號(hào)碼',
`nickname` varchar(255) NOT NULL,
`password`? varchar(32)? DEFAULT NULL COMMENT 'MD5(MD5(pass+固定salt) + salt)',
`salt` varchar(10)? DEFAULT NULL,
`head` varchar(128) DEFAULT NULL? COMMENT '頭像,云存儲(chǔ)的ID',
`register_date`? datetime DEFAULT? NULL COMMENT? '注冊(cè)時(shí)間',
`last_login_date`? datetime DEFAULT? NULL COMMENT '上次登錄時(shí)間',
`login_count` int(11)? DEFAULT? '0'? COMMENT? '登錄次數(shù)',
PRIMARY KEY (`id`)
) ENGINE=InnoDB? DEFAULT CHARSET=utf8