头脑王者数据库.sql 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. CREATE TABLE `conf_address` (
  2. `address_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '地址编号',
  3. `parent_address_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上级地址编号',
  4. `level` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '地址层级,见AddressLevel',
  5. `name` VARCHAR(128) COMMENT '地址名称',
  6. `cn_name` VARCHAR(128) COMMENT '中文地址名称',
  7. PRIMARY KEY (`address_id`)
  8. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT '地址表';
  9. CREATE TABLE `conf_local_address` (
  10. `id` int(11) unsigned NOT NULL COMMENT '编号',
  11. `name` varchar(50) DEFAULT NULL COMMENT '地址名称',
  12. `parent_id` int(11) unsigned DEFAULT NULL COMMENT '父编号',
  13. `short_name` varchar(50) DEFAULT NULL COMMENT '简称',
  14. `level_type` tinyint(2) unsigned zerofill DEFAULT '00' COMMENT '级别',
  15. `zip_code` int(11) DEFAULT NULL COMMENT '区号',
  16. `merger_name` varchar(255) DEFAULT NULL COMMENT '完整地址',
  17. `lng` double DEFAULT NULL COMMENT '经度',
  18. `lat` double DEFAULT NULL COMMENT '纬度',
  19. `pinyin` varchar(255) DEFAULT NULL COMMENT '拼音',
  20. `sort_flag` int(11) DEFAULT NULL COMMENT '排序',
  21. PRIMARY KEY (`id`)
  22. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='中国省市表';
  23. CREATE TABLE `user` (
  24. `user_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户编号',
  25. `phone` VARCHAR(11) COMMENT '手机号码',
  26. `password` VARCHAR(64) COMMENT '登陆密码',
  27. `country_id` INT(11) UNSIGNED COMMENT '国家编号',
  28. `prov_id` INT(11) UNSIGNED COMMENT '省份编号',
  29. `city_id` INT(11) UNSIGNED COMMENT '城市编号',
  30. `language` VARCHAR(8) COMMENT '语言',
  31. `nick_name` VARCHAR(64) COMMENT '昵称',
  32. `head_img` VARCHAR(256) COMMENT '头像',
  33. `gender` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '性别,见Gender',
  34. `openid` VARCHAR(64) COMMENT '微信openid',
  35. `unionid` VARCHAR(64) COMMENT '微信unionid',
  36. `recom_code` VARCHAR(64) COMMENT '邀请码',
  37. `reg_channel` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '注册渠道,见RegChannel',
  38. `recom_user_id` INT(11) UNSIGNED COMMENT '邀请者编号',
  39. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  40. PRIMARY KEY (`user_id`)
  41. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8mb4 COMMENT '用户表';
  42. CREATE TABLE `user_ext` (
  43. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  44. `rank_dan` TINYINT(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT '段位,见RankDan',
  45. `cell` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '脑细胞值',
  46. `split_time` DATETIME DEFAULT NULL COMMENT '上次分裂时间',
  47. `award_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '累计奖励金额',
  48. `pay_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '累计支付金额',
  49. `refund_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '累计退款金额',
  50. `game_room_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '累计有奖竞答次数',
  51. `update_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  52. PRIMARY KEY (`user_id`)
  53. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '用户扩展表';
  54. CREATE TABLE `user_login` (
  55. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  56. `key` VARCHAR(32) NOT NULL COMMENT '登陆key',
  57. `session_key` VARCHAR(64) COMMENT '微信session_key',
  58. `client` VARCHAR(64) NOT NULL COMMENT '客户端型号',
  59. `version` INT(11) UNSIGNED NOT NULL COMMENT '版本号',
  60. `last_ip` INT(11) UNSIGNED NOT NULL COMMENT '最后登陆IP',
  61. `last_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后登陆时间',
  62. PRIMARY KEY (`user_id`)
  63. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '用户登陆表';
  64. CREATE TABLE `user_friend` (
  65. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  66. `user_friend_id` INT(11) UNSIGNED NOT NULL COMMENT '好友编号',
  67. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  68. PRIMARY KEY (`user_id`, `user_friend_id`)
  69. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '用户好友关系表';
  70. CREATE TABLE `user_share` (
  71. `share_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '分享编号',
  72. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  73. `type` TINYINT(4) UNSIGNED NOT NULL COMMENT '分享类型,见ShareType',
  74. `code` VARCHAR(32) COMMENT '分享标识',
  75. `visit_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '访问数',
  76. `game_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联比赛编号',
  77. `group_id` VARCHAR(64) COMMENT '群组编号',
  78. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  79. PRIMARY KEY (`share_id`)
  80. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8 COMMENT '用户分享登记表';
  81. CREATE TABLE `user_cell_log` (
  82. `log_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '日志编号',
  83. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  84. `cell` INT(11) NOT NULL COMMENT '脑细胞值',
  85. `ref` TINYINT(4) UNSIGNED NOT NULL COMMENT '关联业务,见CellRef',
  86. `ref_id` VARCHAR(32) COMMENT '关联业务编号',
  87. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  88. PRIMARY KEY (`log_id`)
  89. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8 COMMENT '用户脑细胞日志表';
  90. CREATE TABLE `sponsor` (
  91. `sponsor_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '赞助商编号',
  92. `name` VARCHAR(64) NOT NULL COMMENT '赞助商名称',
  93. `logo` VARCHAR(256) COMMENT '赞助商logo',
  94. `desc` VARCHAR(128) COMMENT '描述说明',
  95. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  96. PRIMARY KEY (`sponsor_id`)
  97. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8mb4 COMMENT '赞助商表';
  98. CREATE TABLE `qa_question` (
  99. `question_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '问题编号',
  100. `question` VARCHAR(256) NOT NULL COMMENT '问题描述',
  101. `a` VARCHAR(256) NOT NULL COMMENT '选项A',
  102. `b` VARCHAR(256) NOT NULL COMMENT '选项B',
  103. `c` VARCHAR(256) NOT NULL COMMENT '选项C',
  104. `d` VARCHAR(256) NOT NULL COMMENT '选项D',
  105. `correct` VARCHAR(8) NOT NULL COMMENT '正确选项',
  106. `tag` TINYINT(4) UNSIGNED COMMENT '标签',
  107. `ref` TINYINT(4) UNSIGNED NOT NULL COMMENT '题目来源,QaRef',
  108. `ref_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '来源编号',
  109. `status` TINYINT(4) UNSIGNED NOT NULL COMMENT '题目状态,QaStatus',
  110. `status_desc` VARCHAR(64) DEFAULT NULL COMMENT '状态描述',
  111. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  112. `update_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  113. PRIMARY KEY (`question_id`)
  114. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '题目表';
  115. CREATE TABLE `game` (
  116. `game_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '游戏编号',
  117. `type` TINYINT(4) UNSIGNED NOT NULL COMMENT '游戏类型,见GameType',
  118. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  119. PRIMARY KEY (`game_id`)
  120. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8 COMMENT '游戏表';
  121. CREATE TABLE `game_question` (
  122. `game_id` INT(11) UNSIGNED NOT NULL COMMENT '游戏编号',
  123. `question_id` INT(11) UNSIGNED NOT NULL COMMENT '问题编号',
  124. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  125. PRIMARY KEY (`game_id`, `question_id`)
  126. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '游戏题目表';
  127. CREATE TABLE `game_question_answer` (
  128. `answer_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '回答编号',
  129. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  130. `game_id` INT(11) UNSIGNED NOT NULL COMMENT '游戏编号',
  131. `question_id` INT(11) UNSIGNED NOT NULL COMMENT '问题编号',
  132. `option` VARCHAR(8) NOT NULL COMMENT '用户选项',
  133. `point_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '得分',
  134. `answer_time` DATETIME NOT NULL COMMENT '回答时间',
  135. PRIMARY KEY (`answer_id`)
  136. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '游戏题目回答表';
  137. CREATE TABLE `game_user` (
  138. `game_id` INT(11) UNSIGNED NOT NULL COMMENT '游戏编号',
  139. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  140. `point_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '得分',
  141. `rank` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '排名',
  142. `award_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励金额',
  143. `share_award_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分享奖励金额',
  144. `reg_channel` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '注册渠道,见RegChannel',
  145. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  146. PRIMARY KEY (`game_id`, `user_id`)
  147. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '游戏用户表';
  148. CREATE TABLE `game_room` (
  149. `game_id` INT(11) UNSIGNED NOT NULL COMMENT '游戏编号',
  150. `title` VARCHAR(32) NOT NULL DEFAULT '趣味问答' COMMENT '标题',
  151. `desc` VARCHAR(64) COMMENT '描述说明',
  152. `logo` VARCHAR(256) COMMENT 'logo',
  153. `ref` TINYINT(4) UNSIGNED NOT NULL COMMENT '赞助商类型',
  154. `ref_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '赞助商编号',
  155. `rule_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '规则编号',
  156. `max_user` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '最多参与人数',
  157. `award_user` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '最多奖励人数',
  158. `award_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励金额',
  159. `question_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '题目数量',
  160. `count_down` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '房间倒计时',
  161. `question_count_down` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '问题倒计时',
  162. `begin_time` DATETIME COMMENT '开始时间',
  163. `status` TINYINT(4) UNSIGNED NOT NULL COMMENT '房间状态,见RoomStatus',
  164. `poundage_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '平台手续费',
  165. `real_user` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '真实用户数',
  166. `robot_user` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '机器人数',
  167. `award_real_user` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励真实用户数',
  168. `award_real_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励真实用户钱',
  169. `award_robot_user` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励机器人数',
  170. `award_robot_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励机器人钱',
  171. `share_award_real_user` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分享用户数',
  172. `share_award_real_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分享用户钱',
  173. `order_no` VARCHAR(32) COMMENT '付款订单号',
  174. `refund_no` VARCHAR(32) COMMENT '退款单号',
  175. PRIMARY KEY (`game_id`)
  176. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '趣味问答游戏表';
  177. CREATE TABLE `game_room_rule` (
  178. `rule_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '规则编号',
  179. `free_user` INT(11) UNSIGNED NOT NULL DEFAULT 1 COMMENT '空闲用户数',
  180. `robot_add_num` VARCHAR(64) NOT NULL COMMENT '首次机器人添加数量范围',
  181. `robot_add_second_1` VARCHAR(64) NOT NULL COMMENT '秒区间1',
  182. `robot_add_num_1` VARCHAR(64) NOT NULL COMMENT '秒区间1机器人添加数量范围',
  183. `robot_add_second_2` VARCHAR(64) NOT NULL COMMENT '秒区间2',
  184. `robot_add_num_2` VARCHAR(64) NOT NULL COMMENT '秒区间2机器人添加数量范围',
  185. `robot_answer_num_1` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '机器人回答1数量',
  186. `robot_answer_cost_1` VARCHAR(64) NOT NULL COMMENT '机器人回答1耗时范围',
  187. `robot_answer_num_2` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '机器人回答2数量',
  188. `robot_answer_cost_2` VARCHAR(64) NOT NULL COMMENT '机器人回答2耗时范围',
  189. `robot_answer_num_3` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '机器人回答3数量',
  190. `robot_answer_cost_3` VARCHAR(64) NOT NULL COMMENT '机器人回答3耗时范围',
  191. `count_down` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '房间倒计时',
  192. `max_user` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '最多参与人数',
  193. `award_user` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '最多奖励人数',
  194. `award_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '奖励金额',
  195. `question_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '题目数量',
  196. `question_count_down` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '问题倒计时',
  197. `award_rule` VARCHAR(256) NOT NULL COMMENT '奖励规则',
  198. `sponsor_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '赞助商编号',
  199. `name` VARCHAR(64) COMMENT '赞助商名称',
  200. `title` VARCHAR(32) NOT NULL DEFAULT '趣味问答' COMMENT '标题',
  201. `logo` VARCHAR(256) COMMENT 'logo',
  202. `room_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '总房间数量',
  203. `gen_room_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '已生成房间数量',
  204. `gen_room_time` DATETIME DEFAULT NULL COMMENT '最后生成房间时间',
  205. `status` TINYINT(4) UNSIGNED NOT NULL COMMENT '规则状态,见RuleStatus',
  206. `status_time` DATETIME DEFAULT NULL COMMENT '状态变化时间',
  207. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  208. `update_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  209. PRIMARY KEY (`rule_id`)
  210. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '趣味问答游戏规则表';
  211. CREATE TABLE `order` (
  212. `order_no` VARCHAR(32) NOT NULL COMMENT '订单编号',
  213. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  214. `product_type` TINYINT(4) UNSIGNED NOT NULL COMMENT '产品类型,见ProductType',
  215. `product_id` INT(11) UNSIGNED COMMENT '产品编号',
  216. `order_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '订单金额',
  217. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  218. `pay_channel` TINYINT(4) UNSIGNED COMMENT '支付渠道,PayChannel',
  219. `pay_status` TINYINT(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT '支付状态,PayStatus',
  220. `pay_no` VARCHAR(64) COMMENT '支付流水号',
  221. `pay_fee` INT(11) UNSIGNED COMMENT '支付金额',
  222. `pay_time` DATETIME COMMENT '支付时间',
  223. PRIMARY KEY (`order_no`)
  224. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '订单表';
  225. CREATE TABLE `order_refund` (
  226. `refund_no` VARCHAR(32) NOT NULL COMMENT '退款编号',
  227. `order_no` VARCHAR(32) NOT NULL COMMENT '订单编号',
  228. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  229. `total_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '订单金额',
  230. `refund_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '退款金额',
  231. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  232. `status` TINYINT(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT '退款状态,RefundStatus',
  233. `refund_id` VARCHAR(64) COMMENT '微信退款单号',
  234. `settlement_refund_fee` INT(11) UNSIGNED COMMENT '退款金额',
  235. `success_time` DATETIME COMMENT '退款时间',
  236. PRIMARY KEY (`refund_no`)
  237. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '退款单表';
  238. CREATE TABLE `wallet` (
  239. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  240. `total_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '累计获取金额',
  241. `apply_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '申请提现中金额',
  242. `finish_fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '已完成提现金额',
  243. `update_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  244. PRIMARY KEY (`user_id`)
  245. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '用户钱包表';
  246. CREATE TABLE `wallet_log` (
  247. `log_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '日志编号',
  248. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  249. `fee` INT(11) NOT NULL DEFAULT 0 COMMENT '金额',
  250. `ref` TINYINT(4) UNSIGNED NOT NULL COMMENT '关联业务,见WalletRef',
  251. `ref_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联业务编号',
  252. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  253. PRIMARY KEY (`log_id`)
  254. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '用户钱包日志表';
  255. CREATE TABLE `wallet_withdraw` (
  256. `withdraw_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '提现编号',
  257. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  258. `fee` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '金额',
  259. `openid` VARCHAR(64) COMMENT '微信OpenID',
  260. `status` TINYINT(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT '提现状态,见WithdrawStatus',
  261. `status_desc` VARCHAR(64) COMMENT '状态描述',
  262. `pay_time` DATETIME COMMENT '支付时间',
  263. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  264. PRIMARY KEY (`withdraw_id`)
  265. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8 COMMENT '用户提现表';
  266. -- 系统管理员表
  267. CREATE TABLE `sys_admin` (
  268. `adminid` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '管理员编号',
  269. `login_name` VARCHAR(32) NOT NULL COMMENT '登陆名',
  270. `psw` VARCHAR(64) NOT NULL COMMENT '登陆密码',
  271. `real_name` VARCHAR(32) COMMENT '真实姓名',
  272. `phone` VARCHAR(13) COMMENT '联系电话(故障后台发送短信通知相关人员)',
  273. `email` VARCHAR(64) COMMENT '联系邮箱(故障后台发送邮件通知相关人员)',
  274. `valid` tinyint(4) NOT NULL DEFAULT 1 COMMENT '生效标示 1-生效 2-失效',
  275. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  276. `last_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最近登陆时间',
  277. PRIMARY KEY (`adminid`)
  278. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT '系统管理员表';
  279. INSERT INTO `brain`.`sys_admin` (`adminid`, `login_name`, `psw`, `real_name`, `phone`, `email`, `valid`, `create_time`, `last_time`) VALUES ('1', 'admin', 'e10adc3949ba59abbe56e057f20f883e', NULL, NULL, NULL, '1', '2018-01-25 13:18:10', '2018-01-25 13:18:10');
  280. -- 用户表openid添加唯一锁引
  281. update `user` set `openid` = NULL where `reg_channel` = 99;
  282. ALTER TABLE `user` ADD UNIQUE INDEX `idx_user_openid` (`openid`);
  283. -- 20180303 排位赛需求
  284. -- add by chensenlai
  285. ALTER TABLE `user_ext` DROP COLUMN `rank_dan`;
  286. ALTER TABLE `user_ext` ADD COLUMN `game_pk_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '累计pk次数' AFTER `game_room_c`;
  287. ALTER TABLE `user_ext` ADD COLUMN `game_rank_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '累计排位赛次数' AFTER `game_pk_c`;
  288. CREATE TABLE `game_pk` (
  289. `game_id` INT(11) UNSIGNED NOT NULL COMMENT '游戏编号',
  290. `parent_game_id` INT(11) UNSIGNED NOT NULL COMMENT '父游戏编号(关联排位赛编号)',
  291. `question_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '题目数量',
  292. `question_count_down` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '答题时限',
  293. `cost` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '脑力值消耗',
  294. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '发起者编号',
  295. `join_user_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '参与者编号',
  296. `type` TINYINT(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'PK类型,见PkType',
  297. `status` TINYINT(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'PK状态,见PkStatus',
  298. `result` TINYINT(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'PK结果,见PkResult',
  299. `result_time` DATETIME DEFAULT NULL COMMENT '结果时间',
  300. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  301. PRIMARY KEY (`game_id`)
  302. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT 'PK赛游戏表';
  303. CREATE TABLE `game_rank` (
  304. `game_id` INT(11) UNSIGNED NOT NULL COMMENT '游戏编号',
  305. `name` VARCHAR(64) NOT NULL COMMENT '赞助商名称',
  306. `title` VARCHAR(64) NOT NULL COMMENT '排位赛名称',
  307. `desc` VARCHAR(128) NOT NULL COMMENT '排位赛描述',
  308. `logo` VARCHAR(256) NOT NULL COMMENT 'logo地址',
  309. `banner` VARCHAR(256) NOT NULL COMMENT 'banner图地址',
  310. `poster` VARCHAR(256) NOT NULL COMMENT '海报图地址',
  311. `begin_time` DATETIME NOT NULL COMMENT '开始时间',
  312. `end_time` DATETIME NOT NULL COMMENT '截止时间',
  313. `status` TINYINT(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT '排位赛状态,见RoomStatus',
  314. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  315. PRIMARY KEY (`game_id`)
  316. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '排位赛表';
  317. CREATE TABLE `game_rank_user` (
  318. `game_id` INT(11) UNSIGNED NOT NULL COMMENT '游戏编号',
  319. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  320. `star_c` INT(11) UNSIGNED NOT NULL COMMENT '星星数',
  321. `play_time` DATETIME NOT NULL COMMENT '参加时间',
  322. PRIMARY KEY (`game_id`, `user_id`)
  323. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '排位赛用户表';
  324. CREATE TABLE `game_rank_group` (
  325. `group_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '组编号',
  326. `game_id` INT(11) UNSIGNED NOT NULL COMMENT '游戏编号',
  327. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  328. `group_code` VARCHAR(256) NOT NULL COMMENT '组标识',
  329. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  330. PRIMARY KEY (`group_id`)
  331. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8 COMMENT '排位赛组表';
  332. CREATE TABLE `game_rank_group_user` (
  333. `group_id` INT(11) UNSIGNED NOT NULL COMMENT '组编号',
  334. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  335. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  336. PRIMARY KEY (`group_id`, `user_id`)
  337. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '排位赛组用户表';
  338. -- 提现补充真实姓名和身份证
  339. ALTER TABLE `user` ADD COLUMN `real_name` VARCHAR(16) DEFAULT NULL COMMENT '真实姓名' AFTER `user_id`;
  340. ALTER TABLE `user` ADD COLUMN `idcard` VARCHAR(32) DEFAULT NULL COMMENT '身份证' AFTER `real_name`;
  341. ALTER TABLE `wallet_withdraw` ADD COLUMN `real_name` VARCHAR(16) DEFAULT NULL COMMENT '真实姓名' AFTER `openid`;
  342. ALTER TABLE `wallet_withdraw` ADD COLUMN `idcard` VARCHAR(32) DEFAULT NULL COMMENT '身份证' AFTER `real_name`;
  343. ALTER TABLE `game_rank` ADD COLUMN `pre_game_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上场排位赛编号' AFTER `game_id`;
  344. -- 20180307 小程序客服消息配置
  345. -- add by chensenlai
  346. CREATE TABLE `kefu_message` (
  347. `message_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '消息编号',
  348. `type` TINYINT(4) UNSIGNED NOT NULL COMMENT '消息类型,见MessageType',
  349. `content` VARCHAR(1024) DEFAULT NULL COMMENT '内容',
  350. PRIMARY KEY (`message_id`)
  351. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '后台消息配置';
  352. -- 20180309 脑力值日志数据更新
  353. -- add by chensenlai
  354. UPDATE `user_cell_log` SET `ref`=51 WHERE `ref`=11;
  355. UPDATE `user_cell_log` SET `ref`=52 WHERE `ref`=12;
  356. -- 20180312 统一整改到参数配置表里面
  357. -- add by chensenlai
  358. DROP TABLE `kefu_message` ;
  359. CREATE TABLE `conf_param` (
  360. `param_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '参数编号',
  361. `gcode` VARCHAR(64) NOT NULL COMMENT '标识码',
  362. `data` VARCHAR(1024) NOT NULL COMMENT '实体数据',
  363. `sort` INT(11) UNSIGNED NOT NULL DEFAULT 1 COMMENT '排序(从小到大)',
  364. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  365. `update_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  366. PRIMARY KEY (`param_id`)
  367. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '参数配置表';
  368. -- add by chensenlai 20180313
  369. -- 脑力值产品可以配置
  370. ALTER TABLE `user_ext` ADD COLUMN `ext` VARCHAR(1024) DEFAULT NULL COMMENT '扩展数据' AFTER `game_rank_c`;
  371. UPDATE `user_ext` SET `ext`='{"onceCellProductId":"1"}' WHERE `user_id` in (select `user_id` from `order` where product_type = 1 AND product_id = 1 and pay_status = 3);
  372. -- 模板提醒
  373. CREATE TABLE `template_message` (
  374. `message_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '模板消息编号',
  375. `type` TINYINT(4) UNSIGNED NOT NULL COMMENT '模板类型',
  376. `form_id` VARCHAR(64) NOT NULL COMMENT '微信formId',
  377. `data` VARCHAR(64) DEFAULT NULL COMMENT '数据编号',
  378. `status` TINYINT(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态',
  379. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  380. `update_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  381. PRIMARY KEY (`message_id`)
  382. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '模板消息';
  383. -- add by chensenlai 2018-03-22
  384. -- 公众号h5页面支付,公众号openid关联小程序openid
  385. CREATE TABLE `user_openid` (
  386. `openid` VARCHAR(64) NOT NULL COMMENT '小程序openid',
  387. `mp_openid` VARCHAR(64) NOT NULL COMMENT '公众号openid',
  388. PRIMARY KEY (`openid`)
  389. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '用户openid关联表';
  390. -- 题目选题
  391. ALTER TABLE `qa_question` ADD COLUMN `code` VARCHAR(32) DEFAULT NULL COMMENT '题目标识码' AFTER `correct`;
  392. ALTER TABLE `qa_question` ADD COLUMN `degree` INT(11) DEFAULT 1 COMMENT '题目难度' AFTER `tag`;
  393. -- 房间规则增加选题规则
  394. ALTER TABLE `game_room_rule` ADD COLUMN `question_rule` VARCHAR(512) DEFAULT NULL COMMENT '选题规则' AFTER `question_count_down`;
  395. -- 排位赛增加选题规则
  396. ALTER TABLE `game_rank` ADD COLUMN `question_rule` VARCHAR(2048) DEFAULT NULL COMMENT '选题规则' AFTER `poster`;
  397. -- add by chensenlai 20180325
  398. -- 黑名单管控
  399. CREATE TABLE `user_blacklist` (
  400. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编号',
  401. `level` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '管控级别:999以上禁止登陆,0~998降分处理',
  402. `desc` VARCHAR(64) DEFAULT NULL COMMENT '说明',
  403. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  404. `update_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  405. PRIMARY KEY (`user_id`)
  406. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '用户黑名单表';
  407. -- 合并题目分类
  408. update `qa_question` SET `tag`=18 WHERE `tag`=5; -- 生物->健康
  409. update `qa_question` SET `tag`=18 WHERE `tag`=19; -- 医学->健康
  410. update `qa_question` SET `tag`=7 WHERE `tag`=16; -- 动漫->娱乐
  411. update `qa_question` SET `tag`=7 WHERE `tag`=17; -- 音乐->娱乐
  412. update `qa_question` SET `tag`=9 WHERE `tag`=10; -- 军事->常识
  413. update `qa_question` SET `tag`=9 WHERE `tag`=4; -- 历史->常识
  414. -- 题目扩展表,记录题目统计信息等扩展数据
  415. -- 应该叫stat_question更加合理,放在stat统计域单独维护,考虑和user_ext同一命名,故还是叫qa_question_ext
  416. CREATE TABLE `qa_question_ext` (
  417. `question_id` INT(11) UNSIGNED NOT NULL COMMENT '题目编号',
  418. `correct_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '答对次数',
  419. `wrong_c` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '答错次数',
  420. PRIMARY KEY (`question_id`)
  421. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '题目扩展表';
  422. -- 数据迁移
  423. CREATE TABLE `game_user_backup` LIKE `game_user`;
  424. CREATE TABLE `game_question_backup` LIKE `game_question`;
  425. CREATE TABLE `game_question_answer_backup` LIKE `game_question_answer`;
  426. -- add by chensenlai 20180330
  427. -- 音乐配置
  428. ALTER TABLE `game_rank` ADD COLUMN `audio_bg` VARCHAR(512) DEFAULT NULL COMMENT '背景音乐' AFTER `poster`;
  429. ALTER TABLE `game_room_rule` ADD COLUMN `audio_wait` VARCHAR(512) DEFAULT NULL COMMENT '等待倒计时音乐' AFTER `logo`;
  430. ALTER TABLE `game_room_rule` ADD COLUMN `audio_bg` VARCHAR(512) DEFAULT NULL COMMENT '背景音乐' AFTER `audio_wait`;
  431. -- 用户出题(备选题库)
  432. CREATE TABLE `qa_question_candidate` (
  433. `candidate_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '候选问题编号',
  434. `question` VARCHAR(256) NOT NULL COMMENT '问题描述',
  435. `a` VARCHAR(256) NOT NULL COMMENT '选项A',
  436. `b` VARCHAR(256) NOT NULL COMMENT '选项B',
  437. `c` VARCHAR(256) NOT NULL COMMENT '选项C',
  438. `d` VARCHAR(256) NOT NULL COMMENT '选项D',
  439. `correct` VARCHAR(8) NOT NULL COMMENT '正确选项',
  440. `tag` TINYINT(4) UNSIGNED COMMENT '标签',
  441. `degree` INT(11) DEFAULT 11 COMMENT '题目难度',
  442. `status` TINYINT(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT '题目状态',
  443. `adminid` INT(11) UNSIGNED NOT NULL COMMENT '出题者编号',
  444. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  445. PRIMARY KEY (`candidate_id`)
  446. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '候选题目表(用于出题同步正式表)';
  447. -- 管理员增加角色
  448. -- 暂时不设计复杂权限系统,够用就行
  449. ALTER TABLE `sys_admin` ADD COLUMN `role` tinyint(4) UNSIGNED NOT NULL DEFAULT 2 COMMENT '角色' AFTER `email`;
  450. -- 消息通知
  451. CREATE TABLE `msg_notice` (
  452. `notice_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '通知编号',
  453. `user_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户编号-0表示全部用户',
  454. `title` VARCHAR(64) DEFAULT NULL COMMENT '通知标题',
  455. `cont` VARCHAR(1024) DEFAULT NULL COMMENT '通知内容',
  456. `status` TINYINT(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态',
  457. `begin_time` DATETIME NOT NULL COMMENT '开始时间',
  458. `end_time` DATETIME NOT NULL COMMENT '截止时间',
  459. `num` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '已通知用户数量',
  460. PRIMARY KEY (`notice_id`)
  461. ) ENGINE=InnoDB AUTO_INCREMENT=100001 DEFAULT CHARSET=utf8 COMMENT '消息通知';
  462. ALTER TABLE `msg_notice` ADD INDEX `idx_user_id` (`user_id`);
  463. INSERT INTO `msg_notice` (`user_id`, `title`, `cont`, `begin_time`, `end_time`) VALUES
  464. (0, '官方公告', '多谢近期用户反馈,冲顶王者先后查封了听风、樱花等十余个开外挂账号。\n\n冲顶王者力争为大家塑造一个客观公正的答题环境,用脑力征服世界!\n\n如果大家还有发现外挂者,可关注[冲顶王者]公众号举报,举报还有奖励哦!', '2018-03-30 03:00:00', '2018-04-02 23:59:59');
  465. INSERT INTO `msg_notice` (`user_id`, `title`, `cont`, `begin_time`, `end_time`) VALUES
  466. (0, '提现说明', '近期用户提现较多。\n\n故冲顶王者再次提醒亲们,提现后请关注提现状态。\n\n状态为提现成功即可在 [微信-服务通知] 收到提现红包,需24小时内领取哦!', '2018-04-03 06:00:00', '2018-04-04 23:59:59');
  467. INSERT INTO `msg_notice` (`user_id`, `title`, `cont`, `begin_time`, `end_time`) VALUES
  468. (0, '新金主入驻', '冲顶王者首页休闲娱乐赛,再添金主赞助商!\n\n英语单词专场,仅限100场!\n\n比拼更垂直的专业能力,开战吧!', '2018-04-09 03:00:00', '2018-04-09 23:59:59');
  469. INSERT INTO `msg_notice` (`user_id`, `title`, `cont`, `begin_time`, `end_time`) VALUES
  470. (0, '赛季倒计时提醒', '冲顶王者第一赛季,将于4月15日23点59分结束!\n\n最后的时间,努力冲刺吧!\n', '2018-04-14 03:00:00', '2018-04-15 22:59:59');
  471. INSERT INTO `msg_notice` (`user_id`, `title`, `cont`, `begin_time`, `end_time`) VALUES
  472. (0, '赛季结束通知', '冲顶王者第一赛季,已于4月15日23点59分结束!\n\n奖励会在今日内发放完毕!\n\n新赛季也会在近日开启,敬请继续关注!\n', '2018-04-16 03:00:00', '2018-04-16 16:59:59');
  473. INSERT INTO `msg_notice` (`user_id`, `title`, `cont`, `begin_time`, `end_time`) VALUES
  474. (0, '赛季开始通知', '冲顶王者第二赛季,已于4月17日10点10分开始!\n\n奖励规则采纳了用户反馈的奖励规则!\n\n即高段位一起平分现金大奖!\n', '2018-04-17 03:00:00', '2018-04-17 23:59:59');
  475. -- 客服会话
  476. CREATE TABLE `msg_message` (
  477. `message_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '客服素材编号',
  478. `type` TINYINT(4) UNSIGNED NOT NULL COMMENT '客服素材类型,见MessageType',
  479. `title` VARCHAR(64) DEFAULT NULL COMMENT '素材标题',
  480. `cont` VARCHAR(1024) DEFAULT NULL COMMENT '素材内容',
  481. `img` VARCHAR(256) DEFAULT NULL COMMENT '图片地址',
  482. `url` VARCHAR(512) DEFAULT NULL COMMENT '链接地址',
  483. `create_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  484. `num` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '已通知用户数量',
  485. PRIMARY KEY (`message_id`)
  486. ) ENGINE=InnoDB AUTO_INCREMENT=100001 DEFAULT CHARSET=utf8 COMMENT '客服消息素材';
  487. CREATE TABLE `msg_message_rule` (
  488. `rule_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '客服规则编号',
  489. `session_from` VARCHAR(32) NOT NULL COMMENT '微信sessionFrom',
  490. `desc` VARCHAR(64) NOT NULL COMMENT '会话说明',
  491. `event` VARCHAR(256) DEFAULT NULL COMMENT '收到事件消息回复素材配置',
  492. `text` VARCHAR(256) DEFAULT NULL COMMENT '收到文本消息回复素材配置',
  493. `image` VARCHAR(256) DEFAULT NULL COMMENT '收到图片消息回复素材配置',
  494. `miniprogrampage` VARCHAR(256) DEFAULT NULL COMMENT '收到小卡片消息回复素材配置',
  495. `client_title` VARCHAR(64) DEFAULT NULL COMMENT '客户端展示标题',
  496. `client_cont` VARCHAR(1024) DEFAULT NULL COMMENT '客户端展示内容',
  497. `client_btn` VARCHAR(64) DEFAULT NULL COMMENT '客户端按扭展示文字',
  498. `client_miniprogrampage` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '客户端小卡片素材编号',
  499. PRIMARY KEY (`rule_id`)
  500. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT '客服规则配置表';
  501. -- 房间广告配置
  502. ALTER TABLE `game_room_rule` ADD COLUMN `message_rule` INT(11) DEFAULT 0 COMMENT '客服会话规则' AFTER `audio_bg`;
  503. -- 排位赛广告配置
  504. ALTER TABLE `game_rank` ADD COLUMN `message_rule` INT(11) DEFAULT 0 COMMENT '客服会话规则' AFTER `question_rule`;
  505. -- 娱乐赛房间脑力消耗配置
  506. ALTER TABLE `game_room_rule` ADD COLUMN `cell` INT(11) NOT NULL DEFAULT -1 COMMENT '消耗脑细胞值 -1-按段位配置 0-不消耗脑力值' AFTER `award_rule`;
  507. -- 模板消息表名更换
  508. ALTER TABLE `template_message` RENAME TO `msg_template`;