CreateTables.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <?php
  2. namespace app\process;
  3. use support\think\Db;
  4. use Workerman\Crontab\Crontab;
  5. /**
  6. * 建表
  7. */
  8. class CreateTables
  9. {
  10. public function onWorkerStart(): void
  11. {
  12. // 每天的0点10执行,注意这里省略了秒位
  13. new Crontab('10 0 * * *', function(){
  14. $this->initStart();
  15. });
  16. }
  17. protected function initStart()
  18. {
  19. echo "开始创建表\n";
  20. $createTablesSqlList = [
  21. $this->base_total_day,
  22. $this->basic_login_total,
  23. $this->base_total_hour,
  24. $this->basic_login_total_game,
  25. $this->basic_login_total_server,
  26. $this->basic_reg_total,
  27. $this->game_active_hour,
  28. $this->server_total_day,
  29. $this->server_total_hour,
  30. ];
  31. foreach ($createTablesSqlList as $sql){
  32. try {
  33. $year = date('Y', strtotime('+1 year'));
  34. $month = date('Ym', strtotime('+1 month'));
  35. $sql = str_replace('{{YEAR}}', $year, $sql);
  36. $sql = str_replace('{{MONTH}}', $month, $sql);
  37. // echo "创建表:".$sql."\n";
  38. Db::connect("db_data_report")->execute($sql);
  39. }catch (\Exception $e){
  40. echo $e->getMessage();
  41. }
  42. }
  43. }
  44. protected string $base_total_day = "CREATE TABLE IF NOT EXISTS `base_total_day_{{YEAR}}` (
  45. `id` int(11) NOT NULL AUTO_INCREMENT,
  46. `tdate` date NOT NULL COMMENT '日期',
  47. `game_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏ID',
  48. `media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
  49. `agent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '渠道ID',
  50. `site_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告位ID',
  51. `auth_id` int(10) NOT NULL DEFAULT '0' COMMENT '负责人ID',
  52. `ad_show_pv` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告展示PV',
  53. `ad_show_ip` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告展示IP',
  54. `ad_click_pv` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告安装PV',
  55. `ad_click_ip` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告安装IP',
  56. `download` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下载数',
  57. `install` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '安装数',
  58. `install_ip` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '安装IP',
  59. `reg_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册数',
  60. `reg_login_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '当天注册当天登陆用户数',
  61. `reg_dev` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册设备',
  62. `login_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登陆总数',
  63. `login_reg_game` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登陆数(注册游戏相同)',
  64. `old_login_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '老用户登陆',
  65. `role_create_user` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建角色用户数',
  66. `reg_pay_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册付费数',
  67. `reg_pay_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册付费金额',
  68. `reg_pay_amount` float unsigned NOT NULL DEFAULT '0' COMMENT '注册付费分成金额',
  69. `pay_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '付费总用户数',
  70. `pay_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '付费总金额',
  71. `pay_amount` float unsigned NOT NULL DEFAULT '0' COMMENT '付费分成总金额',
  72. `reg_pay_num_rg` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册付费数(剔除跨游戏)',
  73. `reg_pay_total_rg` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册付费金额(剔除跨游戏)',
  74. `reg_pay_amount_rg` float unsigned NOT NULL DEFAULT '0' COMMENT '注册付费分成金额(剔除跨游戏)',
  75. `pay_num_rg` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '付费总用户数(剔除跨游戏)',
  76. `pay_total_rg` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '付费总金额(剔除跨游戏)',
  77. `pay_amount_rg` float unsigned NOT NULL DEFAULT '0' COMMENT '付费分成总金额(剔除跨游戏)',
  78. PRIMARY KEY (`id`) USING BTREE,
  79. UNIQUE KEY `select_index` (`tdate`,`agent_id`,`site_id`,`game_id`) USING BTREE,
  80. KEY `agent_id` (`agent_id`) USING BTREE,
  81. KEY `site_id` (`site_id`) USING BTREE,
  82. KEY `game_id` (`game_id`) USING BTREE,
  83. KEY `auth_id` (`auth_id`) USING BTREE,
  84. KEY `media_id` (`media_id`) USING BTREE
  85. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
  86. protected string $basic_login_total = "CREATE TABLE IF NOT EXISTS `basic_login_total_{{YEAR}}` (
  87. `id` int(11) NOT NULL AUTO_INCREMENT,
  88. `tdate` date NOT NULL COMMENT '登录时间',
  89. `agent_id` int(11) NOT NULL COMMENT '渠道ID',
  90. `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '广告位ID',
  91. `cplaceid` varchar(50) DEFAULT NULL COMMENT '子ID',
  92. `adid` varchar(20) DEFAULT NULL COMMENT '创意ID',
  93. `turn` int(10) unsigned NOT NULL COMMENT '轮数ID',
  94. `login_count` int(11) NOT NULL COMMENT '账号数',
  95. `active` int(10) unsigned NOT NULL COMMENT '活跃天数(0:当天)',
  96. `plat_id` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '平台ID',
  97. PRIMARY KEY (`id`) USING BTREE,
  98. KEY `tdate` (`tdate`) USING BTREE,
  99. KEY `agent_id` (`agent_id`) USING BTREE,
  100. KEY `site_id` (`site_id`) USING BTREE,
  101. KEY `plat_id` (`plat_id`) USING BTREE,
  102. KEY `active` (`active`) USING BTREE
  103. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
  104. protected string $base_total_hour = "CREATE TABLE IF NOT EXISTS `base_total_hour_{{MONTH}}` (
  105. `id` int(11) NOT NULL AUTO_INCREMENT,
  106. `tdate` date NOT NULL COMMENT '日期',
  107. `thour` tinyint(3) unsigned NOT NULL COMMENT '小时',
  108. `game_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏ID',
  109. `media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
  110. `agent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '渠道ID',
  111. `site_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告位ID',
  112. `auth_id` int(10) NOT NULL DEFAULT '0' COMMENT '负责人ID',
  113. `ad_show_pv` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告展示PV',
  114. `ad_show_ip` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告展示IP',
  115. `ad_click_pv` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告安装PV',
  116. `ad_click_ip` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告安装IP',
  117. `cost` decimal(14,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '消耗金额',
  118. `download` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下载数',
  119. `install` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '安装数',
  120. `install_ip` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '安装IP',
  121. `reg_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册数',
  122. `reg_login_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册登陆用户',
  123. `reg_dev` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册设备',
  124. `login_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登陆总数',
  125. `login_reg_game` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登陆数(注册游戏相同)',
  126. `old_login_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '老用户登陆',
  127. `role_create_user` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建用户数',
  128. `reg_pay_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '小时注册当天付费数',
  129. `reg_pay_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '小时注册当天付费金额',
  130. `reg_pay_amount` float unsigned NOT NULL DEFAULT '0' COMMENT '小时注册当天分成金额',
  131. `reg_pay_num_rg` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册累计付费数',
  132. `reg_pay_total_rg` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册累计付费金额',
  133. `reg_pay_amount_rg` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册累计分成金额',
  134. `pay_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '付费总用户数',
  135. `pay_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '付费总金额',
  136. `pay_amount` float unsigned NOT NULL DEFAULT '0' COMMENT '付费分成总金额',
  137. `pay_num_rg` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '付费总用户数(剔除跨游戏)',
  138. `pay_total_rg` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '付费总金额(剔除跨游戏)',
  139. `pay_amount_rg` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '付费分成总金额(剔除跨游戏)',
  140. PRIMARY KEY (`id`) USING BTREE,
  141. UNIQUE KEY `select_index` (`tdate`,`thour`,`agent_id`,`site_id`,`game_id`) USING BTREE,
  142. KEY `tdate` (`tdate`) USING BTREE,
  143. KEY `thour` (`thour`) USING BTREE,
  144. KEY `agent_id` (`agent_id`) USING BTREE,
  145. KEY `media_id` (`media_id`) USING BTREE,
  146. KEY `auth_id` (`auth_id`) USING BTREE,
  147. KEY `site_id` (`site_id`) USING BTREE,
  148. KEY `game_id` (`game_id`) USING BTREE
  149. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
  150. protected string $basic_login_total_game = "CREATE TABLE IF NOT EXISTS `basic_login_total_game_{{YEAR}}` (
  151. `id` int(11) NOT NULL AUTO_INCREMENT,
  152. `tdate` date NOT NULL COMMENT '登录时间',
  153. `agent_id` int(11) NOT NULL COMMENT '渠道ID',
  154. `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '广告位ID',
  155. `cplaceid` varchar(50) DEFAULT NULL COMMENT '子ID',
  156. `adid` varchar(20) DEFAULT NULL COMMENT '创意ID',
  157. `game_id` int(10) unsigned NOT NULL COMMENT '游戏ID',
  158. `turn` int(10) unsigned NOT NULL COMMENT '轮数ID',
  159. `login_count` int(11) NOT NULL COMMENT '账号数',
  160. `active` int(10) unsigned NOT NULL COMMENT '活跃天数(0:当天)',
  161. `plat_id` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '平台ID',
  162. PRIMARY KEY (`id`) USING BTREE,
  163. KEY `tdate` (`tdate`) USING BTREE,
  164. KEY `agent_id` (`agent_id`) USING BTREE,
  165. KEY `site_id` (`site_id`) USING BTREE,
  166. KEY `game_id` (`game_id`) USING BTREE,
  167. KEY `plat_id` (`plat_id`) USING BTREE,
  168. KEY `active` (`active`) USING BTREE
  169. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";
  170. protected string $basic_login_total_server = "CREATE TABLE IF NOT EXISTS `basic_login_total_server_{{YEAR}}` (
  171. `id` int(11) NOT NULL AUTO_INCREMENT,
  172. `tdate` date NOT NULL COMMENT '登录时间',
  173. `agent_id` int(11) NOT NULL COMMENT '渠道ID',
  174. `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '广告位ID',
  175. `cplaceid` varchar(50) DEFAULT NULL COMMENT '子ID',
  176. `adid` varchar(20) DEFAULT NULL COMMENT '创意ID',
  177. `game_id` int(10) unsigned NOT NULL COMMENT '游戏ID',
  178. `server_id` int(11) NOT NULL DEFAULT '0' COMMENT '服务器ID',
  179. `turn` int(10) unsigned NOT NULL COMMENT '轮数ID',
  180. `login_count` int(11) NOT NULL COMMENT '账号数',
  181. `active` int(10) unsigned NOT NULL COMMENT '活跃天数(0:当天)',
  182. `plat_id` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '平台ID',
  183. PRIMARY KEY (`id`) USING BTREE,
  184. KEY `tdate` (`tdate`) USING BTREE,
  185. KEY `agent_id` (`agent_id`) USING BTREE,
  186. KEY `site_id` (`site_id`) USING BTREE,
  187. KEY `game_id` (`game_id`) USING BTREE,
  188. KEY `server_id` (`server_id`) USING BTREE,
  189. KEY `plat_id` (`plat_id`) USING BTREE,
  190. KEY `active` (`active`) USING BTREE
  191. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";
  192. protected string $basic_reg_total = "CREATE TABLE IF NOT EXISTS `basic_reg_total_{{YEAR}}` (
  193. `id` int(11) NOT NULL AUTO_INCREMENT,
  194. `tdate` date NOT NULL COMMENT '日期',
  195. `thour` tinyint(4) NOT NULL COMMENT '小时',
  196. `agent_id` int(11) NOT NULL COMMENT '渠道ID',
  197. `site_id` int(11) NOT NULL COMMENT '广告位ID',
  198. `adid` varchar(100) DEFAULT '' COMMENT '创意ID',
  199. `turn` int(11) DEFAULT '0' COMMENT '轮数',
  200. `cplaceid` varchar(100) DEFAULT '' COMMENT '子ID',
  201. `reg_count` int(11) NOT NULL DEFAULT '0' COMMENT '注册数',
  202. `login_count` int(11) NOT NULL DEFAULT '0' COMMENT '登录数',
  203. `game_id` int(11) NOT NULL COMMENT '游戏ID',
  204. `server_id` int(11) NOT NULL DEFAULT '0' COMMENT '服务器ID',
  205. `plat_id` tinyint(4) NOT NULL DEFAULT '0' COMMENT '平台ID',
  206. PRIMARY KEY (`id`) USING BTREE,
  207. KEY `tdate` (`tdate`) USING BTREE,
  208. KEY `thour` (`thour`) USING BTREE,
  209. KEY `agent_id` (`agent_id`) USING BTREE,
  210. KEY `site_id` (`site_id`) USING BTREE,
  211. KEY `game_id` (`game_id`) USING BTREE,
  212. KEY `server_id` (`server_id`) USING BTREE,
  213. KEY `adid` (`adid`) USING BTREE,
  214. KEY `cplaceid` (`cplaceid`) USING BTREE,
  215. KEY `plat_id` (`plat_id`) USING BTREE
  216. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='注册日志基础统计表';";
  217. protected string $game_active_hour = "CREATE TABLE IF NOT EXISTS `game_active_hour_{{MONTH}}` (
  218. `id` int(11) NOT NULL AUTO_INCREMENT,
  219. `game_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏ID',
  220. `media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
  221. `agent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '渠道ID',
  222. `site_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告位ID',
  223. `auth_id` int(10) NOT NULL DEFAULT '0' COMMENT '负责人ID',
  224. `reg_date` date NOT NULL COMMENT '日期',
  225. `thour` tinyint(3) unsigned NOT NULL COMMENT '小时',
  226. `days` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃天数(0当天登陆)',
  227. `active_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃数',
  228. `active_reg_game` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃数(注册游戏相同)',
  229. `pay_total` float NOT NULL DEFAULT '0',
  230. PRIMARY KEY (`id`) USING BTREE,
  231. UNIQUE KEY `select_index` (`reg_date`,`thour`,`days`,`agent_id`,`site_id`,`game_id`) USING BTREE,
  232. KEY `reg_date` (`reg_date`) USING BTREE,
  233. KEY `thour` (`thour`) USING BTREE,
  234. KEY `agent_id` (`agent_id`) USING BTREE,
  235. KEY `site_id` (`site_id`) USING BTREE,
  236. KEY `media_id` (`media_id`) USING BTREE,
  237. KEY `auth_id` (`auth_id`) USING BTREE,
  238. KEY `game_id` (`game_id`) USING BTREE
  239. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='注册活跃表(按小时统计)';";
  240. protected string $server_total_day = "CREATE TABLE IF NOT EXISTS `server_total_day_{{YEAR}}` (
  241. `id` int(11) NOT NULL AUTO_INCREMENT,
  242. `tdate` date NOT NULL COMMENT '日期',
  243. `game_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏ID',
  244. `media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
  245. `agent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '渠道ID',
  246. `site_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告位ID',
  247. `auth_id` int(10) NOT NULL DEFAULT '0' COMMENT '负责人ID',
  248. `server_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '区服ID',
  249. `user_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登陆用户数(数据上报)',
  250. `new_user_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新登陆用户(进入游戏)',
  251. `reg_user_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册登陆数(数据上报)',
  252. `role_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏角色登陆数',
  253. `role_create_user` int(10) unsigned DEFAULT '0' COMMENT '创建角色用户数',
  254. `role_create_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏创角数',
  255. `pay_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '充值人数',
  256. `pay_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '充值金额',
  257. `reg_pay_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册付费人数',
  258. `reg_pay_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册付费金额',
  259. `gf_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '衮服登陆用户数',
  260. `gf_pay_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '衮服付费数',
  261. `gf_pay_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '衮服付费金额',
  262. PRIMARY KEY (`id`) USING BTREE,
  263. UNIQUE KEY `select_index` (`tdate`,`agent_id`,`site_id`,`game_id`,`server_id`) USING BTREE,
  264. KEY `tdate` (`tdate`) USING BTREE,
  265. KEY `agent_id` (`agent_id`) USING BTREE,
  266. KEY `site_id` (`site_id`) USING BTREE,
  267. KEY `game_id` (`game_id`) USING BTREE,
  268. KEY `media_id` (`media_id`) USING BTREE,
  269. KEY `auth_id` (`auth_id`) USING BTREE,
  270. KEY `server_id` (`server_id`) USING BTREE
  271. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='按区服统计总表';";
  272. protected string $server_total_hour = "CREATE TABLE IF NOT EXISTS `server_total_hour_{{MONTH}}` (
  273. `id` int(11) NOT NULL AUTO_INCREMENT,
  274. `tdate` date NOT NULL COMMENT '日期',
  275. `thour` tinyint(4) NOT NULL COMMENT '小时',
  276. `game_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏ID',
  277. `media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
  278. `agent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '渠道ID',
  279. `site_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告位ID',
  280. `auth_id` int(10) NOT NULL DEFAULT '0' COMMENT '负责人ID',
  281. `server_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '区服ID',
  282. `user_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登陆用户数(数据上报)',
  283. `new_user_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新登陆用户(进入游戏)',
  284. `reg_user_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册登陆数(数据上报)',
  285. `role_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏角色登陆数',
  286. `role_create_user` int(10) unsigned DEFAULT '0' COMMENT '创建角色用户数',
  287. `role_create_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏创角数',
  288. `pay_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '充值人数',
  289. `pay_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '充值金额',
  290. PRIMARY KEY (`id`) USING BTREE,
  291. UNIQUE KEY `select_index` (`tdate`,`thour`,`agent_id`,`site_id`,`game_id`,`server_id`) USING BTREE,
  292. KEY `tdate` (`tdate`) USING BTREE,
  293. KEY `thour` (`thour`) USING BTREE,
  294. KEY `agent_id` (`agent_id`) USING BTREE,
  295. KEY `site_id` (`site_id`) USING BTREE,
  296. KEY `game_id` (`game_id`) USING BTREE,
  297. KEY `media_id` (`media_id`) USING BTREE,
  298. KEY `auth_id` (`auth_id`) USING BTREE,
  299. KEY `server_id` (`server_id`) USING BTREE
  300. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='按区服统计小时总表';";
  301. }