install.sql 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. CREATE TABLE IF NOT EXISTS `__PREFIX__wechat_autoreply` (
  2. `id` int(10) NOT NULL AUTO_INCREMENT,
  3. `title` varchar(100) NOT NULL DEFAULT '' COMMENT '标题',
  4. `text` varchar(100) NOT NULL DEFAULT '' COMMENT '触发文本',
  5. `eventkey` varchar(50) NOT NULL DEFAULT '' COMMENT '响应事件',
  6. `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
  7. `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  8. `createtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  9. `updatetime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  10. `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
  11. PRIMARY KEY (`id`),
  12. KEY `eventkey` (`eventkey`)
  13. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='微信自动回复表';
  14. BEGIN;
  15. INSERT INTO `__PREFIX__wechat_autoreply`(`id`, `title`, `text`, `eventkey`, `remark`, `weigh`, `createtime`, `updatetime`, `status`) VALUES (1, '输入hello', 'hello', '58c7d908c4570', '', 1, 1493366855, 1493366855, 'normal');
  16. INSERT INTO `__PREFIX__wechat_autoreply`(`id`, `title`, `text`, `eventkey`, `remark`, `weigh`, `createtime`, `updatetime`, `status`) VALUES (2, '输入你好', '你好', '58fdfaa9e1965', '', 2, 1493704976, 1493704976, 'normal');
  17. COMMIT;
  18. CREATE TABLE IF NOT EXISTS `__PREFIX__wechat_captcha` (
  19. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  20. `event` varchar(100) DEFAULT '' COMMENT '事件',
  21. `openid` varchar(255) DEFAULT NULL COMMENT '用户openid',
  22. `context` varchar(20) DEFAULT NULL COMMENT '上下文',
  23. `code` varchar(30) DEFAULT NULL COMMENT '验证码',
  24. `times` int(10) unsigned DEFAULT '0' COMMENT '验证次数',
  25. `ip` varchar(50) DEFAULT '' COMMENT 'IP',
  26. `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  27. PRIMARY KEY (`id`),
  28. KEY `ip` (`ip`,`event`) USING BTREE,
  29. KEY `openid` (`openid`(191),`event`)
  30. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='微信公众号验证码';
  31. CREATE TABLE IF NOT EXISTS `__PREFIX__wechat_config` (
  32. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  33. `name` varchar(50) NOT NULL DEFAULT '' COMMENT '配置名称',
  34. `title` varchar(50) NOT NULL DEFAULT '' COMMENT '配置标题',
  35. `value` text NOT NULL COMMENT '配置值',
  36. `createtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  37. `updatetime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  38. PRIMARY KEY (`id`),
  39. UNIQUE KEY `name` (`name`) USING BTREE
  40. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='微信配置表';
  41. BEGIN;
  42. INSERT INTO `__PREFIX__wechat_config` VALUES ('1', 'menu', '微信菜单', '[{\"name\":\"FastAdmin\",\"sub_button\":[{\"name\":\"官网\",\"type\":\"view\",\"url\":\"http:\\/\\/www.fastadmin.net\"},{\"name\":\"在线演示\",\"type\":\"click\",\"key\":\"\"},{\"name\":\"文档\",\"type\":\"view\",\"url\":\"http:\\/\\/doc.fastadmin.net\"}]},{\"name\":\"在线客服\",\"type\":\"click\",\"key\":\"58cb852984970\"},{\"name\":\"关于我们\",\"type\":\"click\",\"key\":\"58bf944aa0777\"}]', '1497398820', '1500538185'), ('2', 'service', '客服配置', '{\"onlinetime\":\"09:00-18:00\",\"offlinemsg\":\"请在工作时间联系客服!\",\"nosessionmsg\":\"当前没有客服在线!请稍后重试!\",\"waitformsg\":\"请问有什么可以帮到您?\"}', '1497429674', '1497429674'), ('3', 'signin', '连续登录配置', '{\"s1\":\"100\",\"s2\":\"200\",\"s3\":\"300\",\"sn\":\"500\"}', '1497429711', '1497429711');
  43. COMMIT;
  44. CREATE TABLE IF NOT EXISTS `__PREFIX__wechat_context` (
  45. `id` int(10) NOT NULL AUTO_INCREMENT,
  46. `openid` varchar(64) NOT NULL DEFAULT '',
  47. `type` varchar(30) NOT NULL DEFAULT '' COMMENT '类型',
  48. `eventkey` varchar(64) NOT NULL DEFAULT '',
  49. `command` varchar(64) NOT NULL DEFAULT '',
  50. `message` varchar(255) NOT NULL DEFAULT '' COMMENT '内容',
  51. `refreshtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后刷新时间',
  52. `createtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  53. `updatetime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  54. PRIMARY KEY (`id`),
  55. KEY `openid` (`openid`,`eventkey`) USING BTREE
  56. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信上下文表';
  57. CREATE TABLE IF NOT EXISTS `__PREFIX__wechat_response` (
  58. `id` int(10) NOT NULL AUTO_INCREMENT,
  59. `title` varchar(100) NOT NULL DEFAULT '' COMMENT '资源名',
  60. `eventkey` varchar(128) NOT NULL DEFAULT '' COMMENT '事件',
  61. `type` enum('text','image','news','voice','video','music','link','app') NOT NULL DEFAULT 'text' COMMENT '类型',
  62. `content` text NOT NULL COMMENT '内容',
  63. `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
  64. `createtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  65. `updatetime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  66. `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
  67. PRIMARY KEY (`id`),
  68. UNIQUE KEY `eventkey` (`eventkey`) USING BTREE
  69. ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='微信资源表';
  70. BEGIN;
  71. INSERT INTO `__PREFIX__wechat_response` VALUES ('1', '签到送积分', '58adaf7876aab', 'app', '{\"app\":\"signin\"}', '', '1487777656', '1487777656', 'normal'), ('2', '关于我们', '58bf944aa0777', 'app', '{\"app\":\"page\",\"id\":\"1\"}', '', '1488950346', '1488950346', 'normal'), ('3', '自动回复1', '58c7d908c4570', 'text', '{\"content\":\"world\"}', '', '1489492232', '1489492232', 'normal'), ('5', '自动回复2', '58fdfaa9e1965', 'text', '{\"content\":\"我是FastAdmin!\"}', '', '1493039785', '1493039785', 'normal');
  72. COMMIT;