install.sql 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. -- ----------------------------
  2. -- Table structure for __PREFIX__weixin_config
  3. -- ----------------------------
  4. CREATE TABLE IF NOT EXISTS `__PREFIX__weixin_config` (
  5. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  6. `name` varchar(30) NOT NULL DEFAULT '' COMMENT '变量名',
  7. `group` varchar(30) NOT NULL DEFAULT '' COMMENT '分组',
  8. `title` varchar(100) NOT NULL DEFAULT '' COMMENT '变量标题',
  9. `tip` varchar(100) NOT NULL DEFAULT '' COMMENT '变量描述',
  10. `type` varchar(30) NOT NULL DEFAULT '' COMMENT '类型:string,text,int,bool,array,datetime,date,file',
  11. `value` text COMMENT '变量值',
  12. `content` text COMMENT '变量字典数据',
  13. `rule` varchar(100) NOT NULL DEFAULT '' COMMENT '验证规则',
  14. `extend` varchar(255) NOT NULL DEFAULT '' COMMENT '扩展属性',
  15. PRIMARY KEY (`id`),
  16. UNIQUE KEY `name` (`name`)
  17. ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='系统配置';
  18. -- ----------------------------
  19. -- Records of __PREFIX__weixin_config
  20. -- ----------------------------
  21. INSERT INTO `__PREFIX__weixin_config` VALUES ('1', 'type', 'weixin', '公众号类型', '', 'radio', '0', '[\"服务号\",\"订阅号\"]', '', '');
  22. INSERT INTO `__PREFIX__weixin_config` VALUES ('2', 'appid', 'weixin', 'AppID', '', 'string', '', '', 'required', '');
  23. INSERT INTO `__PREFIX__weixin_config` VALUES ('3', 'appsecret', 'weixin', 'AppSecret', '', 'string', '', '', 'required', '');
  24. INSERT INTO `__PREFIX__weixin_config` VALUES ('4', 'token', 'weixin', '微信验证TOKEN', '', 'string', '', '', '', '');
  25. INSERT INTO `__PREFIX__weixin_config` VALUES ('5', 'encode', 'weixin', '消息加解密方式', '', 'radio', '0', '[\"明文模式\",\"兼容模式\",\"安全模式\"]', '', '');
  26. INSERT INTO `__PREFIX__weixin_config` VALUES ('6', 'encodingaeskey', 'weixin', 'EncodingAESKey', '', 'string', '', '', '', '');
  27. INSERT INTO `__PREFIX__weixin_config` VALUES ('7', 'qrcode', 'weixin', '公众号二维码', '', 'image', '', '', '', '');
  28. INSERT INTO `__PREFIX__weixin_config` VALUES ('8', 'share_img', 'weixin', '微信分享图片', '', 'image', '', '', '', '');
  29. INSERT INTO `__PREFIX__weixin_config` VALUES ('9', 'share_title', 'weixin', '微信分享标题', '', 'string', '', '', '', '');
  30. INSERT INTO `__PREFIX__weixin_config` VALUES ('10', 'share_synopsis', 'weixin', '微信分享简介', '', 'text', '', '', '', '');
  31. INSERT INTO `__PREFIX__weixin_config` VALUES ('11', 'avatar', 'weixin', '公众号logo', '', 'image', '', '', '', '');
  32. INSERT INTO `__PREFIX__weixin_config` VALUES ('13', 'routine_appid', 'xiaochengxu', 'AppID', '', 'string', '', '', 'required', '');
  33. INSERT INTO `__PREFIX__weixin_config` VALUES ('14', 'routine_appsecret', 'xiaochengxu', 'AppSecret', '', 'string', '', '', 'required', '');
  34. INSERT INTO `__PREFIX__weixin_config` VALUES ('15', 'routine_logo', 'xiaochengxu', '小程序logo', '', 'image', '', '', '', '');
  35. INSERT INTO `__PREFIX__weixin_config` VALUES ('16', 'routine_name', 'xiaochengxu', '小程序名称', '', 'string', '', '', '', '');
  36. -- ----------------------------
  37. -- Table structure for __PREFIX__weixin_reply
  38. -- ----------------------------
  39. CREATE TABLE IF NOT EXISTS `__PREFIX__weixin_reply` (
  40. `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '微信关键字回复id',
  41. `key` varchar(64) NOT NULL DEFAULT '' COMMENT '关键字',
  42. `type` enum('text','image','news','voice') NOT NULL DEFAULT 'text' COMMENT '回复类型',
  43. `data` text COMMENT '回复数据',
  44. `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态',
  45. `hide` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否隐藏',
  46. PRIMARY KEY (`id`) USING BTREE,
  47. UNIQUE KEY `key` (`key`) USING BTREE,
  48. KEY `type` (`type`) USING BTREE,
  49. KEY `status` (`status`) USING BTREE,
  50. KEY `hide` (`hide`) USING BTREE
  51. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='微信关键字回复表';
  52. -- ----------------------------
  53. -- Table structure for __PREFIX__weixin_news
  54. -- ----------------------------
  55. CREATE TABLE IF NOT EXISTS `__PREFIX__weixin_news` (
  56. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '图文消息表',
  57. `cate_name` varchar(255) NOT NULL COMMENT '图文名称',
  58. `description` varchar(255) NOT NULL COMMENT '图文简介',
  59. `image` varchar(255) NOT NULL DEFAULT '' COMMENT '封面',
  60. `url` varchar(255) NOT NULL DEFAULT '' COMMENT 'URL',
  61. `sort` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  62. `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态',
  63. `parent_id` varchar(255) NOT NULL DEFAULT '0' COMMENT '消息父id',
  64. `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  65. PRIMARY KEY (`id`) USING BTREE
  66. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='图文消息管理表';
  67. -- ----------------------------
  68. -- Table structure for __PREFIX__weixin_template
  69. -- ----------------------------
  70. CREATE TABLE IF NOT EXISTS `__PREFIX__weixin_template` (
  71. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '模板id',
  72. `tempkey` char(50) NOT NULL DEFAULT '' COMMENT '模板编号',
  73. `name` char(100) NOT NULL DEFAULT '' COMMENT '模板名',
  74. `content` varchar(1000) NOT NULL DEFAULT '' COMMENT '回复内容',
  75. `tempid` char(100) DEFAULT NULL COMMENT '模板ID',
  76. `add_time` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间',
  77. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态',
  78. PRIMARY KEY (`id`) USING BTREE,
  79. KEY `tempkey` (`tempkey`) USING BTREE
  80. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='微信模板';
  81. -- ----------------------------
  82. -- Table structure for __PREFIX__weixin_user
  83. -- ----------------------------
  84. CREATE TABLE IF NOT EXISTS `__PREFIX__weixin_user` (
  85. `uid` int(10) unsigned NOT NULL COMMENT '微信用户id',
  86. `unionid` varchar(30) DEFAULT NULL COMMENT '只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段',
  87. `openid` varchar(30) DEFAULT NULL COMMENT '用户的标识,对当前公众号唯一',
  88. `routine_openid` varchar(32) DEFAULT NULL COMMENT '小程序唯一身份ID',
  89. `nickname` varchar(64) NOT NULL COMMENT '用户的昵称',
  90. `headimgurl` varchar(256) NOT NULL COMMENT '用户头像',
  91. `sex` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '用户的性别,值为1时是男性,值为2时是女性,值为0时是未知',
  92. `city` varchar(64) NOT NULL COMMENT '用户所在城市',
  93. `language` varchar(64) NOT NULL COMMENT '用户的语言,简体中文为zh_CN',
  94. `province` varchar(64) NOT NULL COMMENT '用户所在省份',
  95. `country` varchar(64) NOT NULL COMMENT '用户所在国家',
  96. `remark` varchar(256) DEFAULT NULL COMMENT '公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注',
  97. `groupid` smallint(5) unsigned DEFAULT '0' COMMENT '用户所在的分组ID(兼容旧的用户分组接口)',
  98. `tagid_list` varchar(256) DEFAULT NULL COMMENT '用户被打上的标签ID列表',
  99. `subscribe` tinyint(3) unsigned DEFAULT '1' COMMENT '用户是否订阅该公众号标识',
  100. `subscribe_time` int(10) unsigned DEFAULT NULL COMMENT '关注公众号时间',
  101. `createtime` int(10) unsigned DEFAULT NULL COMMENT '添加时间',
  102. `parent_id` int(11) unsigned DEFAULT NULL COMMENT '一级推荐人',
  103. `session_key` varchar(32) DEFAULT NULL COMMENT '小程序用户会话密匙',
  104. `user_type` varchar(32) DEFAULT 'wechat' COMMENT '用户类型',
  105. PRIMARY KEY (`uid`) USING BTREE,
  106. KEY `groupid` (`groupid`) USING BTREE,
  107. KEY `subscribe_time` (`subscribe_time`) USING BTREE,
  108. KEY `createtime` (`createtime`) USING BTREE,
  109. KEY `subscribe` (`subscribe`) USING BTREE,
  110. KEY `unionid` (`unionid`) USING BTREE,
  111. KEY `parent_id` (`parent_id`) USING BTREE,
  112. KEY `openid` (`openid`) USING BTREE
  113. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信用户表';
  114. -- ----------------------------
  115. -- Table structure for __PREFIX__weixin_routinetemplate
  116. -- ----------------------------
  117. CREATE TABLE IF NOT EXISTS `__PREFIX__weixin_routinetemplate` (
  118. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '模板id',
  119. `tempkey` char(50) NOT NULL COMMENT '模板编号',
  120. `name` char(100) NOT NULL COMMENT '模板名',
  121. `content` varchar(1000) NOT NULL COMMENT '回复内容',
  122. `tempid` char(100) DEFAULT NULL COMMENT '模板ID',
  123. `add_time` int(11) NOT NULL COMMENT '添加时间',
  124. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态',
  125. PRIMARY KEY (`id`) USING BTREE,
  126. KEY `tempkey` (`tempkey`) USING BTREE
  127. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='微信模板';
  128. -- ----------------------------
  129. -- Table structure for __PREFIX__weixin_cache
  130. -- ----------------------------
  131. CREATE TABLE IF NOT EXISTS `__PREFIX__weixin_cache` (
  132. `key` varchar(32) NOT NULL,
  133. `result` text COMMENT '缓存数据',
  134. `expire_time` int(10) NOT NULL DEFAULT '0' COMMENT '失效时间0=永久',
  135. `add_time` int(10) DEFAULT NULL COMMENT '缓存时间',
  136. PRIMARY KEY (`key`) USING BTREE,
  137. KEY `key` (`key`)
  138. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信缓存表';