DDL
CREATE TABLE `sun_accreds` (
`accredId` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`accredName` varchar(50) NOT NULL COMMENT '名称',
`accredImg` varchar(150) NOT NULL DEFAULT '0' COMMENT '图标',
`dataFlag` tinyint(4) NOT NULL COMMENT '删除标志 -1:删除 1:有效',
`create Time` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`accredId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DDL
CREATE TABLE `sun_ad_positions` (
`positionId` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id 1:电脑端 2:微信端 3:手机端 4:app端 5:小程序端',
`positionType` tinyint(4) NOT NULL DEFAULT '0' COMMENT '广告类型',
`positionName` varchar(100) NOT NULL COMMENT '广告位置名称',
`positionWidth` int(11) NOT NULL DEFAULT '0' COMMENT '建议宽度',
`positionHeight` int(11) NOT NULL DEFAULT '0' COMMENT '建议高度',
`dataFlag` tinyint(4) NOT NULL DEFAULT '1' COMMENT '有效状态 1:有效 -1:无效',
`positionCode` varchar(20) DEFAULT NULL COMMENT '广告位置代码 N/A',
`apSort` int(11) NOT NULL COMMENT '排序号',
PRIMARY KEY (`positionId`),
CONSTRAINT `sun_ad_positions_ibfk_1` FOREIGN KEY (`positionId`) REFERENCES `sun_ads` (`adId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DDL
CREATE TABLE `sun_addons` (
`addonId` int(10) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`name` varchar(40) NOT NULL COMMENT '插件名称',
`title` varchar(20) NOT NULL COMMENT '插件标题',
`description` text COMMENT '插件描述',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '插件状态 0:未安装 1:启用 2:禁用',
`conflg` text COMMENT '插件配置参数json',
`author` varchar(40) DEFAULT NULL COMMENT '插件作者',
`version` varchar(20) DEFAULT NULL COMMENT '插件版本号',
`creaTime` datetime NOT NULL COMMENT '创建时间',
`isConflg` tinyint(4) DEFAULT '0' COMMENT '是否配置 1:已配置 0:未配置',
`updateTime` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`addonId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DDL
CREATE TABLE `sun_ads` (
`adId` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`adPositionId` int(11) NOT NULL DEFAULT '0' COMMENT '广告位置ID',
`adFile` varchar(150) NOT NULL COMMENT '广告文件',
`adName` varchar(100) NOT NULL COMMENT '广告名称',
`adURL` varchar(255) NOT NULL COMMENT '广告网址',
`adStartDate` date NOT NULL COMMENT '广告开始时间',
`adEndDate` date NOT NULL COMMENT '广告结束时间',
`adSort` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
`adClickNum` int(11) NOT NULL DEFAULT '0' COMMENT '广告点击数',
`positionType` tinyint(4) DEFAULT '0' COMMENT '广告类型 1:电脑端 2:微信端 3:手机端 4:app端 5:小程序端',
`dataFlag` tinyint(4) NOT NULL DEFAULT '1' COMMENT '删除标志 -1:删除 1:有效',
`createTime` datetime NOT NULL COMMENT '创建时间',
`subTitle` varchar(255) DEFAULT NULL COMMENT '副标题',
PRIMARY KEY (`adId`),
KEY `adPositionId` (`adPositionId`),
CONSTRAINT `sun_ads_ibfk_1` FOREIGN KEY (`adPositionId`) REFERENCES `sun_accreds` (`accredId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DDL
CREATE TABLE `sun_areas` (
`areald` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`parentld` int(11) NOT NULL COMMENT '父ID',
`areaName` varchar(100) NOT NULL COMMENT '地区名称',
`isShow` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否显示 0:是 1:否',
`areaSort` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
`areaKey` char(10) NOT NULL COMMENT '地区首字母',
`areaType` tinyint(4) NOT NULL DEFAULT '1' COMMENT '级别标志 1:省 2:市 3:县区',
`dataFlag` tinyint(4) NOT NULL DEFAULT '1' COMMENT '删除标志 -1:删除 1:有效',
`createTime` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`areald`),
KEY `parentld` (`parentld`),
CONSTRAINT `sun_areas_ibfk_1` FOREIGN KEY (`parentld`) REFERENCES `sun_accreds` (`accredId`),
CONSTRAINT `sun_areas_ibfk_2` FOREIGN KEY (`parentld`) REFERENCES `sun_addons` (`addonId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DDL
CREATE TABLE `sun_article_cats` (
`catId` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`parentId` int(11) NOT NULL DEFAULT '0' COMMENT '父ID',
`catType` tinyint(4) NOT NULL DEFAULT '0' COMMENT '分类类型 0:普通类型 1:系统类型',
`isShow` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否显示 0:隐藏 1:显示',
`catName` varchar(20) NOT NULL COMMENT '分类名称',
`catSort` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
`dataFlag` tinyint(4) NOT NULL DEFAULT '1' COMMENT '删除标志',
`createTime` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`catId`),
KEY `parentId` (`parentId`),
CONSTRAINT `sun_article_cats_ibfk_1` FOREIGN KEY (`parentId`) REFERENCES `sun_addons` (`addonId`),
CONSTRAINT `sun_article_cats_ibfk_2` FOREIGN KEY (`parentId`) REFERENCES `sun_articles` (`articleld`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DDL
CREATE TABLE `sun_articles` (
`articleld` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`catld` int(11) NOT NULL COMMENT '分类ID',
`articleTitle` varchar(200) NOT NULL COMMENT '文章标题',
`isShow` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否显示 0:隐藏 1:显示',
`articleContent` longtext NOT NULL COMMENT '文章内容',
`articleKey` varchar(200) DEFAULT NULL COMMENT '关键字',
`staffld` int(11) NOT NULL COMMENT '创建者',
`dataFlag` tinyint(4) NOT NULL DEFAULT '1' COMMENT '有效状态 1:有效 -1:无效',
`createTime` datetime NOT NULL COMMENT '创建时间',
`solve` int(10) unsigned DEFAULT '0' COMMENT '觉得文章有帮助的次\n数',
`unsolve` int(10) unsigned DEFAULT '0' COMMENT '觉得文章没帮助的次\n数',
`coverlmg` varchar(150) DEFAULT NULL COMMENT '文章封面图片',
`visitorNum` int(10) unsigned DEFAULT '0' COMMENT '浏览数',
`TypeStatus` int(10) DEFAULT '1' COMMENT '布局类型 1:左图右文 2:左文右图 3:上文下图 4:全文',
`likeNum` int(10) DEFAULT '0' COMMENT '点赞数',
`catSort` int(11) DEFAULT '0' COMMENT '排序号',
`articleDesc` varchar(600) NOT NULL COMMENT '文章描述',
`isHide` tinyint(4) DEFAULT '0' COMMENT '是否隐藏不可编辑/删\n除的文章 1:是 0:否',
PRIMARY KEY (`articleld`),
KEY `catld` (`catld`),
KEY `staffld` (`staffld`),
CONSTRAINT `sun_articles_ibfk_1` FOREIGN KEY (`catld`) REFERENCES `sun_addons` (`addonId`),
CONSTRAINT `sun_articles_ibfk_2` FOREIGN KEY (`catld`) REFERENCES `sun_article_cats` (`catId`),
CONSTRAINT `sun_articles_ibfk_3` FOREIGN KEY (`staffld`) REFERENCES `sun_article_cats` (`catId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DDL
CREATE TABLE `sun_attributes` (
`attrId` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`goodsCatId` int(11) NOT NULL DEFAULT '0' COMMENT '最后一级商品分类ID',
`goodsCatPath` varchar(100) NOT NULL COMMENT '商品分类路径',
`attrName` varchar(100) NOT NULL COMMENT '属性名称',
`attrType` tinyint(4) NOT NULL DEFAULT '0' COMMENT '属性类型 0:输入框 1:多选项 2:下拉框',
`attrVal` text COMMENT '属性值',
`attrSort` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
`isShow` tinyint(4) DEFAULT '1' COMMENT '是否显示 1:显示 0:不显示',
`dataFlag` tinyint(4) NOT NULL DEFAULT '1' COMMENT '有效状态 1:有效 -1:无效',
`createTime` datetime NOT NULL COMMENT '创建时间',
`shopld` int(11) DEFAULT '0' COMMENT '店铺ID 如果有值则说明是店铺属性',
PRIMARY KEY (`attrId`),
KEY `shopld` (`shopld`),
KEY `goodsCatId` (`goodsCatId`),
CONSTRAINT `sun_attributes_ibfk_1` FOREIGN KEY (`goodsCatId`) REFERENCES `sun_accreds` (`accredId`),
CONSTRAINT `sun_attributes_ibfk_2` FOREIGN KEY (`shopld`) REFERENCES `sun_accreds` (`accredId`),
CONSTRAINT `sun_attributes_ibfk_3` FOREIGN KEY (`goodsCatId`) REFERENCES `sun_addons` (`addonId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;