model.sql 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. CREATE TABLE `$basic_table` (
  2. `id` int(10) unsigned NOT NULL auto_increment,
  3. `cat_id` int(10) unsigned NOT NULL default '0',
  4. `parent_cat_id` int(10) unsigned NOT NULL default '0',
  5. `root_cat_id` int(10) unsigned NOT NULL default '0',
  6. `type_id` int(10) unsigned NOT NULL default '0',
  7. `title` char(255) NOT NULL default '',
  8. `thumb` varchar(500) NOT NULL default '',
  9. `keywords` varchar(500) NOT NULL default '',
  10. `description` varchar(500) NOT NULL default '',
  11. `is_link` tinyint(1) unsigned NOT NULL default '0',
  12. `url` varchar(500) NOT NULL default '',
  13. `status` tinyint(1) unsigned NOT NULL default '1',
  14. `is_new` tinyint(1) unsigned NOT NULL default '1',
  15. `is_hot` tinyint(1) unsigned NOT NULL default '1',
  16. `is_recommend` tinyint(1) unsigned NOT NULL default '1',
  17. `sys_add` tinyint(1) unsigned NOT NULL default '0',
  18. `is_position` tinyint(1) unsigned NOT NULL default '0',
  19. `md5` char(32) NOT NULL default '',
  20. `theme` char(50) NOT NULL default '',
  21. `cat_ids` char(255) NOT NULL default '',
  22. `user_name` char(50) NOT NULL,
  23. `user_id` int(10) NOT NULL default '0',
  24. `views` int(10) unsigned NOT NULL default '0',
  25. `favors` int(10) unsigned NOT NULL default '0',
  26. `digs` int(10) unsigned NOT NULL default '0',
  27. `list_order` int(10) unsigned NOT NULL default '0',
  28. `create_time` bigint(20) NOT NULL default '0',
  29. `update_time` bigint(20) NOT NULL default '0',
  30. PRIMARY KEY (`id`),
  31. KEY `status` (`status`),
  32. KEY `list_order` (`list_order`),
  33. KEY `md5` (`md5`),
  34. KEY `cat_id` (`cat_id`),
  35. KEY `cat_ids` (`cat_ids`)
  36. ) ENGINE=MyISAM;
  37. CREATE TABLE `$table_data` (
  38. `id` int(10) unsigned NOT NULL,
  39. `content` text NOT NULL,
  40. `read_price` decimal(12,2) unsigned NOT NULL default '0',
  41. `pay_type` tinyint(1) unsigned NOT NULL default '0',
  42. `group_ids_view` varchar(500) NOT NULL default '',
  43. `pagination_type` tinyint(1) DEFAULT NULL,
  44. `maxchar_perpage` mediumint(6) DEFAULT NULL,
  45. `template` varchar(100) NOT NULL default '',
  46. `allow_comment` tinyint(1) unsigned NOT NULL default '1',
  47. `relation` varchar(1000) NOT NULL default '',
  48. PRIMARY KEY (`id`),
  49. KEY `id` (`id`)
  50. ) ENGINE=MyISAM;
  51. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'cat_id', '栏目', '', '', 1, 10, '/^[0-9]{1,10}$/', '请选择栏目', 'cat_id', 'array (\n ''default_value'' => '''',\n)', '', '-99', '-99', 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0);
  52. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'type_id', '类别', '', '', 1, 10, '', '', 'type_id', '', '', '', '', 0, 1, 0, 1, 1, 1, 0, 0, 0, 2, 0);
  53. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'title', '标题', '', 'input_title', 1, 255, '', '请输入标题', 'title', '', '', '', '', 0, 1, 0, 1, 1, 1, 1, 1, 0, 3, 0);
  54. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position` , `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'keywords', '关键词', '多个关键词“,”隔开', '', 0, 500, '', '', 'keywords', '', '', '-99', '-99', 0, 1, 0, 1, 1, 1, 1, 0, 0, 4, 0);
  55. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'description', '摘要', '', '', 0, 500, '', '', 'textarea', 'array (\r\n ''width'' => ''100'',\r\n ''height'' => ''46'',\r\n ''default_value'' => '''',\r\n ''enable_html'' => ''0'',\r\n)', '', '', '', 0, 1, 0, 1, 0, 1, 1, 1, 0, 5, 0);
  56. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'content', '内容', '', '', 0, 999999, '', '内容不能为空', 'editor', 'array (\n ''tool_bar'' => ''basic'',\n ''height'' => ''300'',\n)', '', '', '', 0, 0, 0, 1, 0, 1, 1, 0, 0, 6, 0);
  57. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'thumb', '封面图', '', '', 0, 500, '', '', 'image', 'array (\n ''front_form_type'' => ''5'',\n ''back_form_type'' => ''5'',\n)', '', '', '', 0, 1, 0, 0, 0, 1, 0, 1, 0, 7, 0);
  58. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'relation', '相关文章', '', '', 0, 1000, '', '', 'omnipotent', 'array (\n "form_text" => "<input type=''hidden'' name=''info[relation]'' id=''relation'' value=''{FIELD_VALUE}'' style=''50'' >\r\n<ul class=''list-dot'' id=''relation_text''></ul>\r\n<div>\r\n<input type=''button'' value=''添加相关'' onclick=omnipotent(''select_id'',''?r=ajax/publicrelationlist&model_id={MODEL_ID}'',''添加相关文章'',1) class=''btn'' style=''''>\r\n<span class=''edit_content''>\r\n<input class=''btn'' value=''显示已有'' onclick=''show_relation({MODEL_ID},{ID})'' type=''button'' style=''''>\r\n</span>\r\n</div>",\n ''field_type'' => ''varchar'',\n ''min_number'' => ''1'',\n)', '', '', '', 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 0);
  59. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'pages', '分页方式', '', '', 0, 1, '', '', 'pages', '', '', '-99', '-99', 0, 0, 0, 1, 0, 0, 0, 0, 0, 9, 0);
  60. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'is_position', '推荐位', '', '', 0, 1, '', '', 'pos_id', '', '', '', '', 0, 1, 0, 1, 0, 0, 0, 0, 0, 10, 0);
  61. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id,'group_ids_view', '阅读权限', '', '', 0, 500, '', '', 'group_id', '', '', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 11, 0);
  62. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'template', '内容页模板', '', '', 0, 100, '', '', 'template','', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0);
  63. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id,'read_price', '阅读收费', '', '', 0, 15, '', '', 'read_price','', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 14,0);
  64. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id,'pay_type', '购买方式', '', '', 0, 1, '', '', 'box', 'array (\n "options" => "现金|1\r\n金币|2\r\n积分|3" ,\n "box_type" => "radio",\n "field_type" => "tinyint",\n "min_number" => "1",\n "width" => "88",\n "size" => "1",\n "default_value" => "1" ,\n "output_type" => "0" ,\n)', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0);
  65. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id,'allow_comment', '允许评论', '', '', 0, 1, '', '', 'box', 'array (\n "options" => "允许评论|1\r\n不允许评论|0" ,\n "box_type" => "radio",\n "field_type" => "tinyint",\n "min_number" => "1",\n "width" => "88",\n "size" => "1",\n "default_value" => "1" ,\n "output_type" => "0" ,\n)', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0);
  66. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'is_link', '转向链接', '', '', 0, 1, '', '', 'is_link', '', '', '', '', 0, 1, 0, 0, 0, 1, 0, 0, 0, 17, 0);
  67. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'url', 'URL', '', '', 0, 500, '', '', 'text', '', '', '', '', 1, 1, 0, 1, 0, 0, 0, 0, 0, 12, 0);
  68. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id,'user_name', '发布人', '', '', 0, 50, '', '', 'text', '', '', '', '', 1, 1, 0, 1, 0, 0, 0, 0, 0, 91, 0);
  69. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'create_time', '发布时间', '', '', 0, 20, '', '', 'datetime', 'array (\n ''save_format'' => ''int'',\n ''show_format'' => ''Y-m-d H:i:s'',\r\n ''read_only'' => ''0'',\n)', '', '', '', 0, 1, 0, 0, 0, 0, 0, 1, 0, 92, 0);
  70. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'update_time', '更新时间', '', '', 0, 20, '', '', 'datetime', 'array (\n ''save_format'' => ''int'',\n ''show_format'' => ''Y-m-d H:i:s'',\r\n ''read_only'' => ''0'',\n)', '', '', '', 1, 1, 0, 1, 0, 0, 0, 0, 0, 93, 0);
  71. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'status', '状态', '', '', 0, 2, '', '', 'box', 'array (\n "options" =>"发布|1\r\n草稿|0",\n "box_type" =>"radio",\n "field_type" => "int",\n "output_type" =>"1",\n)', '', '', '', 0, 1, 0, 1, 0, 0, 0, 0, 0, 94, 0);
  72. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'is_new', '最新', '', '', 0, 1, '', '', 'box', 'array (\n "options" =>"是|1\r\n否|0",\n "box_type" =>"radio",\n "field_type" => "int",\n "output_type" =>"1",\n)', '', '', '', 0, 1, 0, 1, 0, 0, 0, 0, 0, 95, 0);
  73. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'is_hot', '热门', '', '', 0, 1, '', '', 'box', 'array (\n "options" =>"是|1\r\n否|0",\n "box_type" =>"radio",\n "field_type" => "int",\n "output_type" =>"1",\n)', '', '', '', 0, 1, 0, 1, 0, 0, 0, 0, 0, 96, 0);
  74. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'is_recommend', '推荐', '', '', 0, 1, '', '', 'box', 'array (\n "options" =>"是|1\r\n否|0",\n "box_type" =>"radio",\n "field_type" => "int",\n "output_type" =>"1",\n)', '', '', '', 0, 1, 0, 1, 0, 0, 0, 0, 0, 97, 0);
  75. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'views', '浏览次数', '', '', 0, 10, '', '', 'number', '', '', '', '', 0, 1, 0, 1, 0, 0, 0, 0, 0, 98, 0);
  76. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'favors', '收藏次数', '', '', 0, 10, '', '', 'number', '', '', '', '', 0, 1, 0, 1, 0, 0, 0, 0, 0, 99, 0);
  77. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'digs', '点赞次数', '', '', 0, 10, '', '', 'number', '', '', '', '', 0, 1, 0, 1, 0, 0, 0, 0, 0, 100, 0);
  78. INSERT INTO `$table_model_field` (`model_id`, `field`, `name`, `tips`, `css`, `min_length`, `max_length`, `pattern`, `error_tips`, `form_type`, `setting`, `form_attribute`, `unset_group_ids`, `unset_role_ids`, `is_core`, `is_system`, `is_unique`, `is_base`, `is_search`, `is_add`, `is_fullsearch`, `is_position`, `is_omnipotent`, `list_order`, `disabled`) VALUES($model_id, 'list_order', '排序', '', '', 0, 10, '', '', 'number', '', '', '', '', 0, 1, 0, 1, 0, 0, 0, 0, 0, 200, 0);