| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- CREATE TABLE IF NOT EXISTS `__PREFIX__cms_category` (
- `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '栏目ID',
- `catname` varchar(30) NOT NULL DEFAULT '' COMMENT '栏目名称',
- `catdir` varchar(30) NOT NULL DEFAULT '' COMMENT '唯一标识',
- `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类别',
- `target` varchar(20) NOT NULL DEFAULT '_self' COMMENT '打开方式',
- `modelid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '模型ID',
- `parentid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '父ID',
- `arrparentid` varchar(255) NOT NULL DEFAULT '' COMMENT '所有父ID',
- `arrchildid` mediumtext COMMENT '所有子栏目ID',
- `child` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否存在子栏目,1存在',
- `image` varchar(255) NOT NULL DEFAULT '' COMMENT '栏目图片',
- `icon` varchar(255) NOT NULL DEFAULT '' COMMENT '栏目图标',
- `description` mediumtext NOT NULL COMMENT '栏目描述',
- `url` varchar(100) NOT NULL DEFAULT '' COMMENT '链接地址',
- `items` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '文档数量',
- `setting` text COMMENT '相关配置信息',
- `listorder` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
- `status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '状态',
- PRIMARY KEY (`id`),
- UNIQUE KEY `catdir` (`catdir`),
- KEY `parentid` (`parentid`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='栏目表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__cms_category_priv` (
- `catid` smallint(5) unsigned NOT NULL DEFAULT '0',
- `roleid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '角色或者组ID',
- `is_admin` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否为管理员 1、管理员',
- `action` varchar(30) NOT NULL DEFAULT '' COMMENT '动作',
- KEY `catid` (`catid`,`roleid`,`is_admin`,`action`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='栏目权限表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__cms_page` (
- `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `catid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '栏目ID',
- `title` varchar(160) NOT NULL DEFAULT '' COMMENT '标题',
- `keywords` varchar(255) NOT NULL DEFAULT '' COMMENT '关键字',
- `description` varchar(255) NOT NULL DEFAULT '' COMMENT 'SEO描述',
- `content` text COMMENT '内容',
- `thumb` varchar(255) NOT NULL DEFAULT '' COMMENT '缩略图',
- `hits` mediumint(8) unsigned DEFAULT '0' COMMENT '点击量',
- `publish_time` int(10) unsigned DEFAULT NULL COMMENT '发布时间',
- `create_time` int(10) unsigned DEFAULT NULL COMMENT '创建时间',
- `update_time` int(10) unsigned DEFAULT NULL COMMENT '更新时间',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='单页内容表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__cms_tags` (
- `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'tagID',
- `tag` varchar(20) NOT NULL DEFAULT '' COMMENT 'tag名称',
- `seo_title` varchar(255) NOT NULL DEFAULT '' COMMENT 'seo标题',
- `seo_keyword` varchar(255) NOT NULL DEFAULT '' COMMENT 'seo关键字',
- `seo_description` varchar(255) NOT NULL DEFAULT '' COMMENT 'seo简介',
- `usetimes` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '信息总数',
- `hits` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '点击数',
- `create_time` int(10) unsigned DEFAULT NULL COMMENT '添加时间',
- `update_time` int(10) unsigned DEFAULT NULL COMMENT '更新时间',
- `listorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
- PRIMARY KEY (`id`),
- UNIQUE KEY `tag` (`tag`),
- KEY `usetimes` (`usetimes`,`listorder`),
- KEY `hits` (`hits`,`listorder`)
- ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='tags主表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__cms_tags_content` (
- `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `tag_id` int(10) DEFAULT NULL COMMENT '标签ID',
- `content_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '信息ID',
- `catid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '栏目ID',
- `update_time` int(10) unsigned DEFAULT NULL COMMENT '更新时间',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='tags数据表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__cms_order` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `trade_sn` varchar(50) DEFAULT '' COMMENT '订单ID',
- `user_id` int(10) unsigned DEFAULT '0' COMMENT '会员ID',
- `content_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '信息ID',
- `catid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '栏目ID',
- `title` varchar(100) DEFAULT NULL COMMENT '订单标题',
- `type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '1金钱or2点数',
- `total_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '订单总价',
- `pay_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实际支付金额',
- `pay_type` varchar(50) DEFAULT NULL COMMENT '支付类型',
- `method` varchar(100) NULL DEFAULT '' COMMENT '支付方法',
- `ip` varchar(50) DEFAULT NULL COMMENT 'IP地址',
- `useragent` varchar(255) DEFAULT NULL COMMENT '用户访问端标识',
- `remark` varchar(255) NOT NULL COMMENT '备注说明',
- `pay_time` int(10) unsigned DEFAULT NULL COMMENT '支付时间',
- `create_time` int(10) unsigned DEFAULT NULL COMMENT '添加时间',
- `update_time` int(10) unsigned DEFAULT NULL COMMENT '更新时间',
- `status` enum('succ','cancel','unpay') NOT NULL DEFAULT 'unpay' COMMENT '状态',
- PRIMARY KEY (`id`),
- KEY `catid` (`catid`,`content_id`),
- KEY `trade_sn` (`trade_sn`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='订单表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__cms_content` (
- `id` int(10) NOT NULL AUTO_INCREMENT,
- `catid` smallint(5) NOT NULL COMMENT '栏目ID',
- `content_id` int(10) NOT NULL COMMENT '信息ID',
- `user_id` mediumint(8) NOT NULL COMMENT '会员ID',
- `username` varchar(16) NOT NULL COMMENT '用户名',
- `create_time` int(10) unsigned DEFAULT NULL COMMENT '添加时间',
- `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态',
- PRIMARY KEY (`id`),
- KEY `user_id` (`catid`,`content_id`,`status`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='会员投稿信息记录表';
- CREATE TABLE `__PREFIX__cms_model` (
- `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
- `module` varchar(15) NOT NULL DEFAULT '' COMMENT '所属模块',
- `name` varchar(30) NOT NULL DEFAULT '' COMMENT '模型名称',
- `tablename` varchar(20) NOT NULL DEFAULT '' COMMENT '表名',
- `description` varchar(100) NOT NULL DEFAULT '' COMMENT '描述',
- `setting` text NOT NULL COMMENT '配置信息',
- `type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '模型类别:1-独立表,2-主附表',
- `create_time` int(10) unsigned DEFAULT NULL COMMENT '添加时间',
- `update_time` int(10) unsigned DEFAULT NULL COMMENT '更新时间',
- `listorder` tinyint(3) NOT NULL DEFAULT '0' COMMENT '排序',
- `status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '状态',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='模型列表';
- CREATE TABLE `__PREFIX__cms_field` (
- `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
- `modelid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '模型ID',
- `name` varchar(20) NOT NULL DEFAULT '' COMMENT '字段名',
- `title` varchar(30) NOT NULL DEFAULT '' COMMENT '别名',
- `remark` tinytext NULL COMMENT '字段提示',
- `pattern` varchar(255) NOT NULL DEFAULT '' COMMENT '数据校验正则',
- `errortips` varchar(255) NOT NULL DEFAULT '' COMMENT '数据校验未通过的提示信息',
- `type` varchar(20) NOT NULL DEFAULT '' COMMENT '字段类型',
- `extend` varchar(255) DEFAULT '' COMMENT '扩展信息',
- `setting` mediumtext NULL COMMENT '字段配置',
- `ifsystem` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否主表字段 1 是',
- `iscore` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否内部字段',
- `iffixed` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否固定不可修改',
- `ifrequire` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否必填',
- `ifsearch` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '作为搜索条件',
- `isadd` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '在投稿中显示',
- `isorder` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否排序',
- `create_time` int(10) unsigned DEFAULT NULL COMMENT '创建时间',
- `update_time` int(10) unsigned DEFAULT NULL COMMENT '更新时间',
- `listorder` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
- `status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '状态',
- PRIMARY KEY (`id`),
- KEY `name` (`name`,`modelid`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='模型字段列表';
- -- 2.2.1 --
- ALTER TABLE `__PREFIX__cms_category`
- ADD COLUMN `target` varchar(20) NOT NULL DEFAULT '_self' COMMENT '打开方式' AFTER `type`;
|