购物车和订单表 - 邕江知青
1、购物车表;
CREATE TABLE `cart` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `goods_id` mediumint(8) unsigned NOT NULL COMMENT \'商品ID\', `goods_attr_id` varchar(30) NOT NULL DEFAULT \'\' COMMENT \'选择的商品属性ID,多个用,隔开\', `goods_number` int(10) unsigned NOT NULL COMMENT \'购买的数量\', `member_id` mediumint(8) unsigned NOT NULL COMMENT \'会员id\', PRIMARY KEY (`id`), KEY `member_id` (`member_id`) ) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COMMENT=\'购物车\';
2、定单基本信息表
CREATE TABLE `order` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `member_id` mediumint(8) unsigned NOT NULL COMMENT \'会员id\', `addtime` int(10) unsigned NOT NULL COMMENT \'下单时间\', `shr_name` varchar(30) NOT NULL COMMENT \'收货人姓名\', `shr_province` varchar(30) NOT NULL COMMENT \'省\', `shr_city` varchar(30) NOT NULL COMMENT \'市\', `shr_area` varchar(30) NOT NULL COMMENT \'地区\', `shr_tel` varchar(30) NOT NULL COMMENT \'收货人电话\', `shr_address` varchar(30) NOT NULL COMMENT \'收货人地址\', `total_price` decimal(10,2) NOT NULL COMMENT \'定单总价\', `post_method` varchar(30) NOT NULL COMMENT \'发货方式\', `pay_method` varchar(30) NOT NULL COMMENT \'支付方式\', `pay_status` tinyint(3) unsigned NOT NULL DEFAULT \'0\' COMMENT \'支付状态,0:未支付 1:已支付\', `post_status` tinyint(3) unsigned NOT NULL DEFAULT \'0\' COMMENT \'发货状态,0:未发货 1:已发货 2:已收到货\', PRIMARY KEY (`id`), KEY `member_id` (`member_id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT=\'定单基本信息\';
3、定单商品
CREATE TABLE `order_goods` ( `order_id` mediumint(8) unsigned NOT NULL COMMENT \'定单id\', `member_id` mediumint(8) unsigned NOT NULL COMMENT \'会员id\', `goods_id` mediumint(8) unsigned NOT NULL COMMENT \'商品ID\', `goods_attr_id` varchar(30) NOT NULL DEFAULT \'\' COMMENT \'选择的属性的ID,如果有多个用,隔开\', `goods_attr_str` varchar(150) NOT NULL DEFAULT \'\' COMMENT \'选择的属性的字符串\', `goods_price` decimal(10,2) NOT NULL COMMENT \'商品的价格\', `goods_number` int(10) unsigned NOT NULL COMMENT \'购买的数量\', KEY `order_id` (`order_id`), KEY `goods_id` (`goods_id`), KEY `member_id` (`member_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=\'定单商品\';
版权声明:本文为li7671269原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。