update.sql 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #########################################################################
  2. ## 玩家实名信息
  3. #########################################################################
  4. DROP TABLE IF EXISTS `h_identify_mem`;
  5. CREATE TABLE `h_identify_mem` (
  6. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  7. `mem_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '玩家id',
  8. `real_name` varchar(128) NOT NULL DEFAULT '' COMMENT '真实姓名',
  9. `identify_type` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '身份证类型',
  10. `id_card` varchar(32) NOT NULL DEFAULT '' COMMENT '身份证号',
  11. `identify_from` varchar(16) NOT NULL DEFAULT '' COMMENT '支付宝 alipay 微信 weixin',
  12. `create_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
  13. `update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
  14. PRIMARY KEY (`id`) USING BTREE,
  15. UNIQUE KEY `im_mem_card_index` (`mem_id`,`id_card`) USING BTREE
  16. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='玩家实名认证信息表';
  17. #########################################################################
  18. ## 身份证号在线时长和消费金额统计
  19. #########################################################################
  20. DROP TABLE IF EXISTS `h_identify_idot`;
  21. CREATE TABLE `h_identify_idot` (
  22. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  23. `id_card` varchar(32) NOT NULL DEFAULT '' COMMENT '证件号identify_card',
  24. `day_online_duration` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '今日在线时长s,每日重置',
  25. `week_online_duration` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '本周在线时长s,每周一重置',
  26. `month_online_duration` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '本月在线时长s,每月一日重置',
  27. `online_duration` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '总在线时长s,不重置',
  28. `day_money` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '今日消费金额,每日重置',
  29. `week_money` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '本周消费金额,每周一重置',
  30. `month_money` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '本月消费金额,每月一日重置',
  31. `sum_money` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总消费金额,不重置',
  32. `create_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
  33. `update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
  34. PRIMARY KEY (`id`) USING BTREE,
  35. UNIQUE KEY `ii_card_index` (`id_card`) USING BTREE
  36. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='实名信息在线时长统计 idot:id_card_online_time';
  37. DROP TABLE IF EXISTS `h_identify_day_idot`;
  38. CREATE TABLE `h_identify_day_idot` (
  39. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  40. `date` date NOT NULL COMMENT '日期',
  41. `mem_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '玩家ID',
  42. `id_card` varchar(32) NOT NULL DEFAULT '' COMMENT '证件号identify_card',
  43. `online_duration` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '在线时长',
  44. `sum_money` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '消费金额',
  45. `create_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
  46. `update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
  47. PRIMARY KEY (`id`) USING BTREE,
  48. UNIQUE KEY `idi_dmi_unique` (`date`,`mem_id`,`id_card`) USING BTREE,
  49. KEY `idi_card_index` (`id_card`) USING BTREE
  50. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='玩家实名每日在线时长统计 idot:id_card_online_time';
  51. #########################################################################
  52. ## 设备号在线时长统计
  53. #########################################################################
  54. DROP TABLE IF EXISTS `h_identify_dot`;
  55. CREATE TABLE `h_identify_dot` (
  56. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  57. `device_id` varchar(64) DEFAULT '' COMMENT '设备ID android 为imei ios 为idfa h5 为 永久cookie标识 huoh5开头标识',
  58. `online_duration` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '在线时长s,下次允许访问时重置',
  59. `next_allow_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '下次允许访问时间',
  60. `create_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
  61. `update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
  62. PRIMARY KEY (`id`) USING BTREE,
  63. UNIQUE KEY `id_device_index` (`device_id`) USING BTREE
  64. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='设备在线时长统计 dot:device_online_time';
  65. DROP TABLE IF EXISTS `h_identify_day_dot`;
  66. CREATE TABLE `h_identify_day_dot` (
  67. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  68. `date` date NOT NULL COMMENT '日期',
  69. `mem_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '玩家ID',
  70. `device_id` varchar(64) DEFAULT '' COMMENT '设备ID android 为imei ios 为idfa h5 为 永久cookie标识 huoh5开头标识',
  71. `online_duration` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '在线时长',
  72. `create_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
  73. `update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
  74. PRIMARY KEY (`id`) USING BTREE,
  75. UNIQUE KEY `idd_dmd_unique` (`date`,`mem_id`,`device_id`) USING BTREE,
  76. KEY `idd_device_index` (`device_id`) USING BTREE
  77. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='玩家设备每日在线时长统计 dot:device_online_time';
  78. #########################################################################
  79. ## 玩家在线时长统计
  80. #########################################################################
  81. DROP TABLE IF EXISTS `h_identify_mot`;
  82. CREATE TABLE `h_identify_mot` (
  83. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  84. `mem_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '玩家ID',
  85. `online_duration` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '在线时长s,下次允许访问时重置',
  86. `next_allow_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '下次允许访问时间',
  87. `create_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
  88. `update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
  89. PRIMARY KEY (`id`) USING BTREE,
  90. UNIQUE KEY `im_mem_index` (`mem_id`) USING BTREE
  91. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='玩家在线时长统计 mot:mem_online_time';
  92. DROP TABLE IF EXISTS `h_identify_day_mot`;
  93. CREATE TABLE `h_identify_day_mot` (
  94. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  95. `date` date NOT NULL COMMENT '日期',
  96. `mem_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '玩家ID',
  97. `online_duration` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '在线时长',
  98. `create_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
  99. `update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
  100. PRIMARY KEY (`id`) USING BTREE,
  101. UNIQUE KEY `idm_dm_unique` (`date`,`mem_id`) USING BTREE
  102. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='玩家每日在线时长统计 mot:mem_online_time';
  103. ##################################################################################
  104. ## 节假日日期配置
  105. ##################################################################################
  106. DROP TABLE IF EXISTS `h_identify_holiday_set`;
  107. CREATE TABLE `h_identify_holiday_set` (
  108. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  109. `year` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '年份',
  110. `holiday` text NOT NULL COMMENT '节假日非周六日日期数组',
  111. `workday` text NOT NULL COMMENT '周六日调班的日期数组',
  112. `create_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
  113. `update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
  114. PRIMARY KEY (`id`),
  115. KEY `hs_year_index` (`year`) USING BTREE
  116. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='节假日配置';
  117. ###############################################################################
  118. ## 游戏表新增 是否实名认证字段 , 已有的不需要添加
  119. ###############################################################################
  120. ALTER TABLE `h_game`
  121. ADD COLUMN `is_auth` TINYINT(2) NOT NULL DEFAULT 1 COMMENT '是否需要强制实名认证,1为 关闭实名认证,2为 强制实名认证 3 开启实名认证' after `is_bt`;
  122. ###############################################################################
  123. ## 渠道实名认证信息表
  124. ###############################################################################
  125. CREATE TABLE `h_identify_agent` (
  126. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  127. `agent_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '渠道id',
  128. `real_name` varchar(128) NOT NULL DEFAULT '' COMMENT '真实姓名',
  129. `identify_type` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '身份证类型',
  130. `id_card` varchar(32) NOT NULL DEFAULT '' COMMENT '身份证号',
  131. `identify_from` varchar(16) NOT NULL DEFAULT '' COMMENT '支付宝 alipay 微信 weixin',
  132. `create_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
  133. `update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
  134. PRIMARY KEY (`id`) USING BTREE,
  135. UNIQUE KEY `im_agent_card_index` (`agent_id`,`id_card`) USING BTREE
  136. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='渠道实名认证信息表';