Datenbankdesign
1,新建数据库onecms
DATENBANK ERSTELLEN onecms;
2,新建goods表:
CREATE TABLE waren(
id int(11) nicht null Primärschlüssel auto_increment,
goodstypeid int(11) NOT NULL,
goodstypefid int(11) NOT NULL,
goodstypefstr varchar(33) NICHT NULL,
title varchar(255) NOT NULL,
flag varchar(33) NOT NULL,
Marktpreis int(11) NICHT NULL,
salesprice int(11) NOT NULL,
housenum int(11) NOT NULL,
Inhalt VARCHAR(255) NICHT NULL,
picurl varchar(255) NOT NULL,
hits int(11),
Bestell-ID int(11),
checkinfo smallint(1),
delstate smallint(1))ENGINE=InnoDB DEFAULT CHARSET=utf8;
3,新建goodstype表
TABELLE ERSTELLEN warentyp(
id int(11) not null primärschlüssel auto_increment,
fid int(11) NOT NULL,
Klassenname varchar(255) NICHT NULL,
orderid int(11) NOT NULL,
checkinfo int(11) NOT NULL,
fstr VARCHAR(33) NICHT NULL)
ENGINE=InnoDB DEFAULT CHARSET=utf8;
4,插入测试数据
Waren表插入数据:
INSERT INTO `goods` VALUES ('1', '2', '0', '0,2,', 'Huawei-Handy', '', '1000', '800', ' 1‘, ‚Huawei P10Plus‘, './uploads/c2922d7d93043572a95bd8b5289a41b.png', '18', '1', '1', '0');
INSERT INTO `goods` VALUES ('2', '4', '3', '0,3,4,', 'Down Jacket', '', '1000', '888', '0', 'Pure Duck Down Jacket', './uploads/1397f1630770e4cc2d407c1911c2ecc.png', '3', '2', '1', '0');
INSERT INTO `goods` VALUES ('3', '1', '0', '0,1,', 'Notebook', '', '3800', '3666', '0', 'Lenovo Thinkpad Notebook', './uploads/fd9ecdaf3ee9a9035f51da6471e3f90.png', '2', '3', '1', '0');
Daten in die Warentyptabelle einfügen:
INSERT INTO `goodstype` VALUES (' 1' , '0', 'Computer', '1', '1', '0,');
INSERT INTO `goodstype` VALUES ('2', '0', 'mobile phone', '2', '1', '0,' ) ;
INSERT INTO `goodstype` VALUES ('3', '0', 'Kleidung', '3', '0', '0,');
INSERT INTO `goodstype` VALUES ('4', '3', 'Down Jacket', ' 4', '1', '0,3,');