`t_dingdan` (`id`),
CONSTRAINT `FK83DFBFFB7E2C405C` FOREIGN KEY (`productid`) REFERENCES `t_product` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
订单统计表t_tongjidj如图4-5.3
图4-5.3订单统计表图
建表的语句为:
CREATE TABLE `t_tongjidj` (
`id` int(11) NOT NULL auto_increment COMMENT '主键',
`chenggong` int(11) NOT NULL default '0' COMMENT '成功的订单数', `day` varchar(255) default NULL COMMENT '日期',
`quxiao` int(11) NOT NULL default '0' COMMENT '取消的订单数', `shengcheng` int(11) NOT NULL default '0' COMMENT '生成的订单数', PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
购物车表t_gouwuche
图4-5.4购物车表图
建表的语句为:
CREATE TABLE `t_gouwuche` (
25
`id` int(11) NOT NULL auto_increment, `createtime` varchar(255) default NULL, `sl` int(11) NOT NULL,
`productid` int(11) default NULL, `userid` int(11) default NULL, PRIMARY KEY (`id`),
KEY `FK445E3420F22E4FAE` (`userid`), KEY `FK445E34207E2C405C` (`productid`),
CONSTRAINT `FK445E34207E2C405C` FOREIGN KEY (`productid`) REFERENCES `t_product` (`id`),
CONSTRAINT `FK445E3420F22E4FAE` FOREIGN KEY (`userid`) REFERENCES `t_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
评价表t_pingjia如图4-5.5
图4-5.5评价表图
建表的SQL语句为:
CREATE TABLE `t_pingjia` (
`id` int(11) NOT NULL auto_increment, `createtime` varchar(255) default NULL, `orderid` varchar(255) default NULL, `pingjia` varchar(255) default NULL, `pingyu` varchar(255) default NULL, `productid` int(11) default NULL,
26
`userid` int(11) default NULL, PRIMARY KEY (`id`),
KEY `FKFCEFD765F22E4FAE` (`userid`), KEY `FKFCEFD7657E2C405C` (`productid`),
CONSTRAINT `FKFCEFD7657E2C405C` FOREIGN KEY (`productid`) REFERENCES `t_product` (`id`),
CONSTRAINT `FKFCEFD765F22E4FAE` FOREIGN KEY (`userid`) REFERENCES `t_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
商品表t_product如图4-5.6
图4-5.6商品表图
建表的SQL语句为:
CREATE TABLE `t_product` (
`id` int(11) NOT NULL auto_increment, `chaping` int(11) NOT NULL,
`createtime` varchar(255) default NULL, `deletestatus` int(11) NOT NULL, `haoping` int(11) NOT NULL,
`imgpath` varchar(255) default NULL,
27
`info` text,
`kucun` int(11) NOT NULL,
`pname` varchar(255) default NULL, `price1` double NOT NULL, `price2` double NOT NULL,
`tuijian` varchar(255) default NULL, `xiaoliang` int(11) NOT NULL, `zhongping` int(11) NOT NULL, `cateid` int(11) default NULL, PRIMARY KEY (`id`),
KEY `FKA91FC024CC32B8E5` (`cateid`),
CONSTRAINT `FKA91FC024CC32B8E5` FOREIGN KEY (`cateid`) REFERENCES `t_cate` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
商品分类表t_cate如图4-5.7
图4-5.7商品分类表
建表的SQL语句为: CREATE TABLE `t_cate` (
`id` int(11) NOT NULL auto_increment, `catename` varchar(255) default NULL, `deletestatus` int(11) NOT NULL, PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
商品统计表t_tongjiproduct如图4-5.8
28