-- phpMyAdmin SQL Dump
-- version 3.4.8
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2018 年 11 月 10 日 17:42
-- 服务器版本: 5.5.54
-- PHP 版本: 5.4.45

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

--
-- 数据库: `temmoku`
--

-- --------------------------------------------------------

--
-- 表的结构 `temmoku_news_article`
--

DROP TABLE IF EXISTS `temmoku_news_article`;
CREATE TABLE IF NOT EXISTS `temmoku_news_article` (
  `aid` mediumint(9) NOT NULL AUTO_INCREMENT COMMENT '自动生成的ID',
  `cid` mediumint(9) NOT NULL DEFAULT '0' COMMENT '栏目的cid',
  `name` varchar(255) DEFAULT '' COMMENT '栏目名称',
  `mid` mediumint(9) DEFAULT '0' COMMENT '模型mid',
  `uid` mediumint(7) DEFAULT '0' COMMENT '发布人的UID',
  `username` varchar(255) DEFAULT '' COMMENT '发布人',
  `title` varchar(255) NOT NULL DEFAULT '' COMMENT '文章标题',
  `seotitle` varchar(255) DEFAULT '' COMMENT 'seo标题',
  `color` varchar(255) DEFAULT '' COMMENT '标题颜色',
  `bold` tinyint(1) DEFAULT '0' COMMENT '是否加粗，1为是 ，0为否',
  `keyword` varchar(255) DEFAULT '' COMMENT '文章关键词',
  `description` text COMMENT '文章简要',
  `author` varchar(255) DEFAULT '' COMMENT '作者',
  `source` varchar(255) DEFAULT '' COMMENT '来源',
  `source_url` varchar(255) DEFAULT '' COMMENT '来源网址',
  `thumb` varchar(255) DEFAULT '' COMMENT '缩略图地址',
  `is_pic` tinyint(1) DEFAULT '0' COMMENT '是否有缩略图1为是 ，默认0不是',
  `posttime` int(10)  DEFAULT NULL COMMENT '发布时间',
  `clicks` int(10) DEFAULT '0' COMMENT '查看次数',
  `state` tinyint(3)  DEFAULT '0' COMMENT '审核状态 1为审 2为未',
  `state_time` int(10)  DEFAULT NULL COMMENT '审核时间',
  `is_recommend` tinyint(3) DEFAULT '0' COMMENT '推荐状态 1为推，2为未',
  `reorder` int(10) DEFAULT '0' COMMENT '排序',
  `comment_num` mediumint(7) DEFAULT '0' COMMENT '评论数量',
  `password` varchar(32)  DEFAULT '' COMMENT '是否是加密文章',
  `sell_jifen` mediumint(9) DEFAULT '0' COMMENT '如果不为false 则为出售文章',
  `is_comment` tinyint(3) DEFAULT '0' COMMENT '是否允许评论 0为可以 1为不可以',
  PRIMARY KEY (`aid`),
  UNIQUE KEY `id` (`aid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;

--
-- 表的结构 `temmoku_news_buyarticle`
--

DROP TABLE IF EXISTS `temmoku_news_buyarticle`;
CREATE TABLE IF NOT EXISTS `temmoku_news_buyarticle` (
  `id` mediumint(9) NOT NULL AUTO_INCREMENT,
  `aid` mediumint(9) NOT NULL DEFAULT '0' COMMENT '文章的aid',
  `uid` mediumint(9) NOT NULL DEFAULT '0' COMMENT '用户的uid',
  `username` varchar(255) NOT NULL DEFAULT '' COMMENT '用户名称',
  `integral` int(11) DEFAULT '0' COMMENT '所付积分',
  `posttime` int(11) DEFAULT NULL COMMENT '付费时间',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COMMENT='文章购买' AUTO_INCREMENT=1 ;


-- --------------------------------------------------------

--
-- 表的结构 `temmoku_news_category`
--

DROP TABLE IF EXISTS `temmoku_news_category`;
CREATE TABLE IF NOT EXISTS `temmoku_news_category` (
  `cid` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `upcid` int(11) DEFAULT '0',
  `level` int(11)  DEFAULT '0' COMMENT '从上到下的级别',
  `type` tinyint(1) DEFAULT '0',
  `cmid` int(11)  DEFAULT '0',
  `reorder` int(11)  DEFAULT '0' COMMENT '排序专用',
  `dir_name` varchar(255) DEFAULT '',
  `seo_name` varchar(255) DEFAULT '',
  `seo_keywords` varchar(255) DEFAULT '',
  `seo_description` varchar(255) DEFAULT '',
  `content` text COMMENT '单页内容',
  `setting` text,
  PRIMARY KEY (`cid`),
  KEY `fid` (`cid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;


--
-- 表的结构 `temmoku_news_comment`
--

DROP TABLE IF EXISTS `temmoku_news_comment`;
CREATE TABLE IF NOT EXISTS `temmoku_news_comment` (
  `id` mediumint(7) NOT NULL AUTO_INCREMENT,
  `aid` mediumint(7) DEFAULT '0',
  `uid` mediumint(7) DEFAULT '0',
  `state` tinyint(1) DEFAULT '0',
  `username` varchar(255) DEFAULT '游客',
  `content` text,
  `posttime` int(10) DEFAULT NULL,
  `reply_id` mediumint(7) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `aid` (`aid`),
  KEY `reply_id` (`reply_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;

--
-- 表的结构 `temmoku_news_content`
--

DROP TABLE IF EXISTS `temmoku_news_content`;
CREATE TABLE IF NOT EXISTS `temmoku_news_content` (
  `nid` mediumint(7) NOT NULL AUTO_INCREMENT,
  `aid` mediumint(7) NOT NULL DEFAULT 0,
  `content` mediumtext,
  PRIMARY KEY (`nid`),
  UNIQUE KEY `nid` (`nid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- 表的结构 `temmoku_news_module`
--

DROP TABLE IF EXISTS `temmoku_news_module`;
CREATE TABLE IF NOT EXISTS `temmoku_news_module` (
  `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL DEFAULT '' COMMENT '目录名称',
  `close` tinyint(1) DEFAULT '0' COMMENT '禁用？',
  `reorder` int(10)  DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `dirname` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='模型表' AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `temmoku_news_setting`
--

DROP TABLE IF EXISTS `temmoku_news_setting`;
CREATE TABLE IF NOT EXISTS `temmoku_news_setting` (
  `id` smallint(6) NOT NULL AUTO_INCREMENT,
  `s_key` varchar(255) NOT NULL DEFAULT '',
  `s_name` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=19 ;

--
-- 转存表中的数据 `temmoku_news_setting`
--

INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(1, 'name', '新闻文章模块');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(2, 'webstate', '1');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(3, 'web_seo_webname', '1');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(4, 'web_seo_keywords', '1');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(5, 'web_seo_description', '1');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(6, 'url_rules', '3');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(7, 'way_close', '模块升级');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(8, 'today_comment_num', '');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(9, 'special_is_open', '1');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(10, 'special_is_fit', '0');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(11, 'add_comment_yzm', '0');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(12, 'special_category_cache_time', '0');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(13, 'special_content_cache_time', '0');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(14, 'index_cache_time', '0');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(15, 'category_cache_time', '0');
INSERT INTO `temmoku_news_setting` (`id`, `s_key`, `s_name`) VALUES(16, 'content_cache_time', '0');

-- --------------------------------------------------------

--
-- 表的结构 `temmoku_news_special_article`
--

DROP TABLE IF EXISTS `temmoku_news_special_article`;
CREATE TABLE IF NOT EXISTS `temmoku_news_special_article` (
  `id` mediumint(9) NOT NULL AUTO_INCREMENT COMMENT '自动生成的ID',
  `lid` mediumint(9) DEFAULT '0' COMMENT '专题的listid',
  `aid` mediumint(9) DEFAULT '0',
  `uid` mediumint(9) DEFAULT '0',
  `username` varchar(255) DEFAULT '',
  `posttime` int(10) DEFAULT NULL COMMENT '添加时间',
  `reorder` int(10) DEFAULT '0' COMMENT '排序',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;

--
-- 表的结构 `temmoku_news_special_category`
--

DROP TABLE IF EXISTS `temmoku_news_special_category`;
CREATE TABLE IF NOT EXISTS `temmoku_news_special_category` (
  `sid` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `upsid` int(11) DEFAULT '0',
  `level` int(11) DEFAULT '0' COMMENT '从上到下的级别',
  `reorder` int(11) DEFAULT '0' COMMENT '排序专用',
  `dir_name` varchar(255) DEFAULT '',
  `seo_name` varchar(255) DEFAULT '',
  `seo_keywords` varchar(255) DEFAULT '',
  `seo_description` varchar(255) DEFAULT '',
  `setting` text,
  PRIMARY KEY (`sid`),
  KEY `sid` (`sid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `temmoku_news_special_comment`
--

DROP TABLE IF EXISTS `temmoku_news_special_comment`;
CREATE TABLE IF NOT EXISTS `temmoku_news_special_comment` (
  `id` mediumint(7) NOT NULL AUTO_INCREMENT,
  `lid` mediumint(7) DEFAULT '0',
  `uid` mediumint(7) DEFAULT '0',
  `state` tinyint(1) DEFAULT '0',
  `username` varchar(255) DEFAULT '游客',
  `content` text,
  `posttime` int(10) DEFAULT NULL,
  `reply_id` mediumint(7) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `aid` (`lid`),
  KEY `reply_id` (`reply_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `temmoku_news_special_list`
--

DROP TABLE IF EXISTS `temmoku_news_special_list`;
CREATE TABLE IF NOT EXISTS `temmoku_news_special_list` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `keyword` varchar(255) DEFAULT '',
  `thumb` varchar(255) DEFAULT '',
  `sid` int(11) DEFAULT '0',
  `reorder` int(11) DEFAULT '0' COMMENT '排序专用',
  `is_comment` tinyint(3) DEFAULT '1',
  `dir_name` varchar(255) DEFAULT '',
  `seo_name` varchar(255) DEFAULT '',
  `seo_keywords` varchar(255) DEFAULT '',
  `seo_description` varchar(255) DEFAULT '',
  `content` text COMMENT '说明',
  `setting` text,
  `clicks` mediumint(9) DEFAULT '0',
  `comment_num` mediumint(9) DEFAULT '0',
  `state` tinyint(3) DEFAULT '0',
  `posttime` int(10) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fid` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;


-- --------------------------------------------------------

--
-- 表的结构 `temmoku_news_attribute_list`
--
DROP TABLE IF EXISTS `temmoku_news_attribute_list`;
CREATE TABLE IF NOT EXISTS `temmoku_news_attribute_list` (
  `id` mediumint(9) unsigned NOT NULL AUTO_INCREMENT,
  `aid` mediumint(9) DEFAULT '0',
  `cid` mediumint(9) DEFAULT '0',
  `mid` mediumint(9) DEFAULT '0',
  `value` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `temmoku_news_field`
--
DROP TABLE IF EXISTS `temmoku_news_field`;
CREATE TABLE IF NOT EXISTS `temmoku_news_field` (
  `id` mediumint(9) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '字段名称',
  `field` varchar(255) NOT NULL DEFAULT '' COMMENT '字段名',
  `field_attr` varchar(255) DEFAULT '' COMMENT '字段属性',
  `field_length` varchar(255) DEFAULT NULL COMMENT '字段长度',
  `type` varchar(255) NOT NULL DEFAULT '' COMMENT '字段类型',
  `unit` varchar(255) DEFAULT '' COMMENT '单位名称',
  `mid` mediumint(9) DEFAULT '0' COMMENT '所属模型',
  `is_search` tinyint(1) DEFAULT '0' COMMENT '是否开启检索 1为可以 0不可以',
  `choice_model` tinyint(3) DEFAULT '0' COMMENT '选择模式，0为单选，1为多选。一般用在前台，比如商城',
  `value` text COMMENT '预设值',
  `is_required` tinyint(1) DEFAULT '0' COMMENT '是否必填 1为必填',
  `is_regular` tinyint(1) DEFAULT '0' COMMENT '是否正则验证',
  `regular` varchar(255) DEFAULT '' COMMENT '正则表达式',
  `regular_msg` varchar(255) DEFAULT '' COMMENT '正则验证不通过时的说明',
  `is_xss` tinyint(1) DEFAULT '0' COMMENT 'XSS过滤 0为不，1为过滤',
  `msg` varchar(255) DEFAULT '' COMMENT '字段输入提示',
  `setting` text COMMENT '其它配置参数，应该是序列化后的数据',
  `height` smallint(6) DEFAULT '0' COMMENT '输入框高度，一般用于textarea',
  `reorder` int(10) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
