DROP TABLE IF EXISTS `book_classification`;
CREATE TABLE `book_classification`(
`book_classification_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '图书分类ID',
`book_category` varchar(64) comment '图书类别',
`examine_state` varchar(16) DEFAULT '已通过' NOT NULL comment '审核状态',
`recommend` int(11) DEFAULT '0' NOT NULL comment '智能推荐',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (book_classification_id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 comment '图书分类';
DROP TABLE IF EXISTS `books`;
CREATE TABLE `books`(
`books_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '图书ID',
`cover` varchar(255) comment '封面',
`book_number` varchar(64) comment '图书编号',
`book_category` varchar(64) comment '图书类别',
`book_name` varchar(64) comment '图书名称',
`publication_date` date comment '出版日期',
`author` varchar(64) comment '作者',
`book_introduction` longtext comment '图书介绍',
`price` varchar(64) comment '价格',
`stock` varchar(64) comment '库存',
`hits` int(11) DEFAULT 0 NOT NULL comment '点击数',
`praise_len` int(11) DEFAULT 0 NOT NULL comment '点赞数',
`examine_state` varchar(16) DEFAULT '已通过' NOT NULL comment '审核状态',
`recommend` int(11) DEFAULT '0' NOT NULL comment '智能推荐',
`goods_id` int(11) DEFAULT '0' NOT NULL comment '关联商品ID',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (books_id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 comment '图书';
DROP TABLE IF EXISTS `book_order`;
CREATE TABLE `book_order`(
`book_order_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '图书订单ID',
`order_number` varchar(64) comment '订单号',
`book_number` varchar(64) comment '图书编号',
`book_name` varchar(64) comment '图书名称',
`price` varchar(64) comment '价格',
`purchase_quantity` varchar(64) comment '购买数量',
`total_price` varchar(64) comment '总价格',
`receiving_address` varchar(64) comment '收货地址',
`contact_number` varchar(64) comment '联系电话',
`consignee_name_` varchar(64) comment '收货人姓名',
`purchase_user` int(11) DEFAULT 0 comment '购买用户',
`examine_state` varchar(16) DEFAULT '未审核' NOT NULL comment '审核状态',
`recommend` int(11) DEFAULT '0' NOT NULL comment '智能推荐',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (book_order_id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 comment '图书订单';
DROP TABLE IF EXISTS `mall_users`;
CREATE TABLE `mall_users`(
`mall_users_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '商城用户ID',
`remarks` varchar(64) comment '备注',
`examine_state` varchar(16) DEFAULT '已通过' NOT NULL comment '审核状态',
`recommend` int(11) DEFAULT '0' NOT NULL comment '智能推荐',
`user_id` int(11) DEFAULT '0' NOT NULL comment '用户ID',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
CREATE TABLE `praise` (
`praise_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '点赞ID:',
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '点赞人:',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间:',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间:',
`source_table` varchar(255) DEFAULT NULL COMMENT '来源表:',
`source_field` varchar(255) DEFAULT NULL COMMENT '来源字段:',
`source_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '来源ID:',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '点赞状态:1为点赞,0已取消',
PRIMARY KEY (`praise_id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='点赞:';
insert into `praise` values ('2','1',"2021-02-22 07:10:59.000 ","2021-03-02 10:24:03.000 ",'article','article_id','7','1');
insert into `praise` values ('25','5',"2021-03-04 10:26:08.000 ","2021-03-04 10:26:08.000 ",'article','article_id','9','1');
insert into `praise` values ('26','5',"2021-03-04 10:26:16.000 ","2021-03-04 10:26:16.000 ",'article','article_id','7','1');
insert into `praise` values ('27','5',"2021-03-04 10:26:20.000 ","2021-03-04 10:26:20.000 ",'article','article_id','7','1');
insert into `praise` values ('44','2',"2021-03-06 02:54:26.000 ","2021-03-06 02:54:26.000 ",'forum','forum_id','2','1');
insert into `praise` values ('50','2',"2021-03-06 03:06:58.000 ","2021-03-06 03:06:58.000 ",'forum','forum_id','2','1');
insert into `praise` values ('54','2',"2021-03-10 03:42:50.000 ","2021-03-10 03:42:50.000 ",'article','article_id','9','1');
insert into `praise` values ('57','0',"2021-03-12 13:00:17.000 ","2021-03-12 13:00:17.000 ",'article','article_id','10','1');
insert into `praise` values ('86','0',"2021-03-15 09:46:34.000 ","2021-03-15 09:46:34.000 ",'article','article_id','6','1');
insert into `praise` values ('101','7',"2021-03-16 04:19:29.000 ","2021-03-16 04:19:29.000 ",'article','article_id','7','1');
insert into `praise` values ('108','2',"2021-03-17 01:45:38.000 ","2021-03-17 01:45:38.000 ",'article','article_id','8','1');
insert into `praise` values ('221','0',"2021-04-02 09:41:16.000 ","2021-04-02 09:41:16.000 ",'article','article_id','2','1');
DROP TABLE IF EXISTS `score`;
CREATE TABLE `score` (
`score_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '评分ID:',
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '评分人:',
`nickname` varchar(64) DEFAULT NULL COMMENT '昵称:',
`score_num` double(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '评分:',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间:',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间:',
`source_table` varchar(255) DEFAULT NULL COMMENT '来源表:',
`source_field` varchar(255) DEFAULT NULL COMMENT '来源字段:',
`source_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '来源ID:',
PRIMARY KEY (`score_id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='评分:';
insert into `score` values ('1','0',null,'5',"2021-02-22 06:55:05.000 ","2021-02-24 02:06:47.000 ",'article','article_id','6');
insert into `score` values ('2','0',null,'3',"2021-02-22 06:55:14.000 ","2021-02-24 02:05:58.000 ",'article','article_id','6');
insert into `score` values ('3','0',null,'3.5',"2021-02-22 06:55:27.000 ","2021-02-22 06:55:29.000 ",'news','news_id','1');
insert into `score` values ('4','0',null,'100',"2021-02-22 06:55:45.000 ","2021-02-22 06:55:45.000 ",'news','news_id','2');
DROP TABLE IF EXISTS `slides`;