|
@@ -1,6 +1,6 @@
|
|
|
<?php
|
|
<?php
|
|
|
|
|
|
|
|
-namespace app\process;
|
|
|
|
|
|
|
+namespace app\process\dataReport;
|
|
|
use support\think\Db;
|
|
use support\think\Db;
|
|
|
use Workerman\Crontab\Crontab;
|
|
use Workerman\Crontab\Crontab;
|
|
|
|
|
|
|
@@ -12,7 +12,7 @@ class CreateTables
|
|
|
public function onWorkerStart(): void
|
|
public function onWorkerStart(): void
|
|
|
{
|
|
{
|
|
|
// 每天的0点10执行,注意这里省略了秒位
|
|
// 每天的0点10执行,注意这里省略了秒位
|
|
|
- new Crontab('10 0 * * *', function(){
|
|
|
|
|
|
|
+ new Crontab('18 * * * *', function(){
|
|
|
$this->initStart();
|
|
$this->initStart();
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -21,30 +21,49 @@ class CreateTables
|
|
|
{
|
|
{
|
|
|
echo "开始创建表\n";
|
|
echo "开始创建表\n";
|
|
|
|
|
|
|
|
- $createTablesSqlList = [
|
|
|
|
|
|
|
+ $centerTablesSqlList = [
|
|
|
$this->base_total_day,
|
|
$this->base_total_day,
|
|
|
- $this->basic_login_total,
|
|
|
|
|
$this->base_total_hour,
|
|
$this->base_total_hour,
|
|
|
- $this->basic_login_total_game,
|
|
|
|
|
- $this->basic_login_total_server,
|
|
|
|
|
- $this->basic_reg_total,
|
|
|
|
|
- $this->game_active_hour,
|
|
|
|
|
- $this->server_total_day,
|
|
|
|
|
- $this->server_total_hour,
|
|
|
|
|
|
|
+ $this->basic_login_total,
|
|
|
|
|
+ $this->game_active_day,
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
- foreach ($createTablesSqlList as $sql){
|
|
|
|
|
|
|
+ foreach ($centerTablesSqlList as $sql){
|
|
|
try {
|
|
try {
|
|
|
- $year = date('Y', strtotime('+1 year'));
|
|
|
|
|
|
|
+ $year = date('Y', strtotime('+1 year'));
|
|
|
$month = date('Ym', strtotime('+1 month'));
|
|
$month = date('Ym', strtotime('+1 month'));
|
|
|
|
|
+
|
|
|
$sql = str_replace('{{YEAR}}', $year, $sql);
|
|
$sql = str_replace('{{YEAR}}', $year, $sql);
|
|
|
$sql = str_replace('{{MONTH}}', $month, $sql);
|
|
$sql = str_replace('{{MONTH}}', $month, $sql);
|
|
|
- // echo "创建表:".$sql."\n";
|
|
|
|
|
|
|
+
|
|
|
Db::connect("db_data_report")->execute($sql);
|
|
Db::connect("db_data_report")->execute($sql);
|
|
|
}catch (\Exception $e){
|
|
}catch (\Exception $e){
|
|
|
echo $e->getMessage();
|
|
echo $e->getMessage();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $logTablesSqlList = [
|
|
|
|
|
+ $this->sdk_active_info,
|
|
|
|
|
+ $this->sdk_reg_log,
|
|
|
|
|
+ $this->sdk_login_log,
|
|
|
|
|
+ $this->sdk_order,
|
|
|
|
|
+ $this->role_log,
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ foreach ($logTablesSqlList as $sql){
|
|
|
|
|
+ try {
|
|
|
|
|
+ $year = date('Y', strtotime('+1 year'));
|
|
|
|
|
+ $month = date('Ym', strtotime('+1 month'));
|
|
|
|
|
+
|
|
|
|
|
+ $sql = str_replace('{{YEAR}}', $year, $sql);
|
|
|
|
|
+ $sql = str_replace('{{MONTH}}', $month, $sql);
|
|
|
|
|
+
|
|
|
|
|
+ Db::connect("db_game_log")->execute($sql);
|
|
|
|
|
+ }catch (\Exception $e){
|
|
|
|
|
+ echo $e->getMessage();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
protected string $base_total_day = "CREATE TABLE IF NOT EXISTS `base_total_day_{{YEAR}}` (
|
|
protected string $base_total_day = "CREATE TABLE IF NOT EXISTS `base_total_day_{{YEAR}}` (
|
|
@@ -89,24 +108,7 @@ class CreateTables
|
|
|
KEY `auth_id` (`auth_id`) USING BTREE,
|
|
KEY `auth_id` (`auth_id`) USING BTREE,
|
|
|
KEY `media_id` (`media_id`) USING BTREE
|
|
KEY `media_id` (`media_id`) USING BTREE
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
|
|
- protected string $basic_login_total = "CREATE TABLE IF NOT EXISTS `basic_login_total_{{YEAR}}` (
|
|
|
|
|
- `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
|
- `tdate` date NOT NULL COMMENT '登录时间',
|
|
|
|
|
- `agent_id` int(11) NOT NULL COMMENT '渠道ID',
|
|
|
|
|
- `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '广告位ID',
|
|
|
|
|
- `cplaceid` varchar(50) DEFAULT NULL COMMENT '子ID',
|
|
|
|
|
- `adid` varchar(20) DEFAULT NULL COMMENT '创意ID',
|
|
|
|
|
- `turn` int(10) unsigned NOT NULL COMMENT '轮数ID',
|
|
|
|
|
- `login_count` int(11) NOT NULL COMMENT '账号数',
|
|
|
|
|
- `active` int(10) unsigned NOT NULL COMMENT '活跃天数(0:当天)',
|
|
|
|
|
- `plat_id` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '平台ID',
|
|
|
|
|
- PRIMARY KEY (`id`) USING BTREE,
|
|
|
|
|
- KEY `tdate` (`tdate`) USING BTREE,
|
|
|
|
|
- KEY `agent_id` (`agent_id`) USING BTREE,
|
|
|
|
|
- KEY `site_id` (`site_id`) USING BTREE,
|
|
|
|
|
- KEY `plat_id` (`plat_id`) USING BTREE,
|
|
|
|
|
- KEY `active` (`active`) USING BTREE
|
|
|
|
|
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
|
|
|
|
|
|
+
|
|
|
protected string $base_total_hour = "CREATE TABLE IF NOT EXISTS `base_total_hour_{{MONTH}}` (
|
|
protected string $base_total_hour = "CREATE TABLE IF NOT EXISTS `base_total_hour_{{MONTH}}` (
|
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
`tdate` date NOT NULL COMMENT '日期',
|
|
`tdate` date NOT NULL COMMENT '日期',
|
|
@@ -153,27 +155,7 @@ class CreateTables
|
|
|
KEY `site_id` (`site_id`) USING BTREE,
|
|
KEY `site_id` (`site_id`) USING BTREE,
|
|
|
KEY `game_id` (`game_id`) USING BTREE
|
|
KEY `game_id` (`game_id`) USING BTREE
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
|
|
- protected string $basic_login_total_game = "CREATE TABLE IF NOT EXISTS `basic_login_total_game_{{YEAR}}` (
|
|
|
|
|
- `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
|
- `tdate` date NOT NULL COMMENT '登录时间',
|
|
|
|
|
- `agent_id` int(11) NOT NULL COMMENT '渠道ID',
|
|
|
|
|
- `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '广告位ID',
|
|
|
|
|
- `cplaceid` varchar(50) DEFAULT NULL COMMENT '子ID',
|
|
|
|
|
- `adid` varchar(20) DEFAULT NULL COMMENT '创意ID',
|
|
|
|
|
- `game_id` int(10) unsigned NOT NULL COMMENT '游戏ID',
|
|
|
|
|
- `turn` int(10) unsigned NOT NULL COMMENT '轮数ID',
|
|
|
|
|
- `login_count` int(11) NOT NULL COMMENT '账号数',
|
|
|
|
|
- `active` int(10) unsigned NOT NULL COMMENT '活跃天数(0:当天)',
|
|
|
|
|
- `plat_id` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '平台ID',
|
|
|
|
|
- PRIMARY KEY (`id`) USING BTREE,
|
|
|
|
|
- KEY `tdate` (`tdate`) USING BTREE,
|
|
|
|
|
- KEY `agent_id` (`agent_id`) USING BTREE,
|
|
|
|
|
- KEY `site_id` (`site_id`) USING BTREE,
|
|
|
|
|
- KEY `game_id` (`game_id`) USING BTREE,
|
|
|
|
|
- KEY `plat_id` (`plat_id`) USING BTREE,
|
|
|
|
|
- KEY `active` (`active`) USING BTREE
|
|
|
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";
|
|
|
|
|
- protected string $basic_login_total_server = "CREATE TABLE IF NOT EXISTS `basic_login_total_server_{{YEAR}}` (
|
|
|
|
|
|
|
+ protected string $basic_login_total = "CREATE TABLE IF NOT EXISTS `basic_login_total_{{YEAR}}` (
|
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
`tdate` date NOT NULL COMMENT '登录时间',
|
|
`tdate` date NOT NULL COMMENT '登录时间',
|
|
|
`agent_id` int(11) NOT NULL COMMENT '渠道ID',
|
|
`agent_id` int(11) NOT NULL COMMENT '渠道ID',
|
|
@@ -181,7 +163,6 @@ class CreateTables
|
|
|
`cplaceid` varchar(50) DEFAULT NULL COMMENT '子ID',
|
|
`cplaceid` varchar(50) DEFAULT NULL COMMENT '子ID',
|
|
|
`adid` varchar(20) DEFAULT NULL COMMENT '创意ID',
|
|
`adid` varchar(20) DEFAULT NULL COMMENT '创意ID',
|
|
|
`game_id` int(10) unsigned NOT NULL COMMENT '游戏ID',
|
|
`game_id` int(10) unsigned NOT NULL COMMENT '游戏ID',
|
|
|
- `server_id` int(11) NOT NULL DEFAULT '0' COMMENT '服务器ID',
|
|
|
|
|
`turn` int(10) unsigned NOT NULL COMMENT '轮数ID',
|
|
`turn` int(10) unsigned NOT NULL COMMENT '轮数ID',
|
|
|
`login_count` int(11) NOT NULL COMMENT '账号数',
|
|
`login_count` int(11) NOT NULL COMMENT '账号数',
|
|
|
`active` int(10) unsigned NOT NULL COMMENT '活跃天数(0:当天)',
|
|
`active` int(10) unsigned NOT NULL COMMENT '活跃天数(0:当天)',
|
|
@@ -191,36 +172,11 @@ class CreateTables
|
|
|
KEY `agent_id` (`agent_id`) USING BTREE,
|
|
KEY `agent_id` (`agent_id`) USING BTREE,
|
|
|
KEY `site_id` (`site_id`) USING BTREE,
|
|
KEY `site_id` (`site_id`) USING BTREE,
|
|
|
KEY `game_id` (`game_id`) USING BTREE,
|
|
KEY `game_id` (`game_id`) USING BTREE,
|
|
|
- KEY `server_id` (`server_id`) USING BTREE,
|
|
|
|
|
KEY `plat_id` (`plat_id`) USING BTREE,
|
|
KEY `plat_id` (`plat_id`) USING BTREE,
|
|
|
KEY `active` (`active`) USING BTREE
|
|
KEY `active` (`active`) USING BTREE
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";
|
|
|
- protected string $basic_reg_total = "CREATE TABLE IF NOT EXISTS `basic_reg_total_{{YEAR}}` (
|
|
|
|
|
- `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
|
- `tdate` date NOT NULL COMMENT '日期',
|
|
|
|
|
- `thour` tinyint(4) NOT NULL COMMENT '小时',
|
|
|
|
|
- `agent_id` int(11) NOT NULL COMMENT '渠道ID',
|
|
|
|
|
- `site_id` int(11) NOT NULL COMMENT '广告位ID',
|
|
|
|
|
- `adid` varchar(100) DEFAULT '' COMMENT '创意ID',
|
|
|
|
|
- `turn` int(11) DEFAULT '0' COMMENT '轮数',
|
|
|
|
|
- `cplaceid` varchar(100) DEFAULT '' COMMENT '子ID',
|
|
|
|
|
- `reg_count` int(11) NOT NULL DEFAULT '0' COMMENT '注册数',
|
|
|
|
|
- `login_count` int(11) NOT NULL DEFAULT '0' COMMENT '登录数',
|
|
|
|
|
- `game_id` int(11) NOT NULL COMMENT '游戏ID',
|
|
|
|
|
- `server_id` int(11) NOT NULL DEFAULT '0' COMMENT '服务器ID',
|
|
|
|
|
- `plat_id` tinyint(4) NOT NULL DEFAULT '0' COMMENT '平台ID',
|
|
|
|
|
- PRIMARY KEY (`id`) USING BTREE,
|
|
|
|
|
- KEY `tdate` (`tdate`) USING BTREE,
|
|
|
|
|
- KEY `thour` (`thour`) USING BTREE,
|
|
|
|
|
- KEY `agent_id` (`agent_id`) USING BTREE,
|
|
|
|
|
- KEY `site_id` (`site_id`) USING BTREE,
|
|
|
|
|
- KEY `game_id` (`game_id`) USING BTREE,
|
|
|
|
|
- KEY `server_id` (`server_id`) USING BTREE,
|
|
|
|
|
- KEY `adid` (`adid`) USING BTREE,
|
|
|
|
|
- KEY `cplaceid` (`cplaceid`) USING BTREE,
|
|
|
|
|
- KEY `plat_id` (`plat_id`) USING BTREE
|
|
|
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='注册日志基础统计表';";
|
|
|
|
|
- protected string $game_active_hour = "CREATE TABLE IF NOT EXISTS `game_active_hour_{{MONTH}}` (
|
|
|
|
|
|
|
+
|
|
|
|
|
+ protected string $game_active_day = "CREATE TABLE IF NOT EXISTS `game_active_day_{{YEAR}}` (
|
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
`game_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏ID',
|
|
`game_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏ID',
|
|
|
`media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
|
|
`media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
|
|
@@ -228,81 +184,173 @@ class CreateTables
|
|
|
`site_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告位ID',
|
|
`site_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告位ID',
|
|
|
`auth_id` int(10) NOT NULL DEFAULT '0' COMMENT '负责人ID',
|
|
`auth_id` int(10) NOT NULL DEFAULT '0' COMMENT '负责人ID',
|
|
|
`reg_date` date NOT NULL COMMENT '日期',
|
|
`reg_date` date NOT NULL COMMENT '日期',
|
|
|
- `thour` tinyint(3) unsigned NOT NULL COMMENT '小时',
|
|
|
|
|
`days` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃天数(0当天登陆)',
|
|
`days` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃天数(0当天登陆)',
|
|
|
`active_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃数',
|
|
`active_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃数',
|
|
|
- `active_reg_game` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃数(注册游戏相同)',
|
|
|
|
|
- `pay_total` float NOT NULL DEFAULT '0',
|
|
|
|
|
PRIMARY KEY (`id`) USING BTREE,
|
|
PRIMARY KEY (`id`) USING BTREE,
|
|
|
- UNIQUE KEY `select_index` (`reg_date`,`thour`,`days`,`agent_id`,`site_id`,`game_id`) USING BTREE,
|
|
|
|
|
|
|
+ UNIQUE KEY `select_index` (`reg_date`, `days`,`agent_id`,`site_id`,`game_id`) USING BTREE,
|
|
|
KEY `reg_date` (`reg_date`) USING BTREE,
|
|
KEY `reg_date` (`reg_date`) USING BTREE,
|
|
|
- KEY `thour` (`thour`) USING BTREE,
|
|
|
|
|
KEY `agent_id` (`agent_id`) USING BTREE,
|
|
KEY `agent_id` (`agent_id`) USING BTREE,
|
|
|
KEY `site_id` (`site_id`) USING BTREE,
|
|
KEY `site_id` (`site_id`) USING BTREE,
|
|
|
KEY `media_id` (`media_id`) USING BTREE,
|
|
KEY `media_id` (`media_id`) USING BTREE,
|
|
|
KEY `auth_id` (`auth_id`) USING BTREE,
|
|
KEY `auth_id` (`auth_id`) USING BTREE,
|
|
|
KEY `game_id` (`game_id`) USING BTREE
|
|
KEY `game_id` (`game_id`) USING BTREE
|
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='注册活跃表(按小时统计)';";
|
|
|
|
|
- protected string $server_total_day = "CREATE TABLE IF NOT EXISTS `server_total_day_{{YEAR}}` (
|
|
|
|
|
|
|
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='活跃表';";
|
|
|
|
|
+
|
|
|
|
|
+ protected string $sdk_active_info = "CREATE TABLE IF NOT EXISTS `sdk_active_info_{{MONTH}}` (
|
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
- `tdate` date NOT NULL COMMENT '日期',
|
|
|
|
|
- `game_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏ID',
|
|
|
|
|
|
|
+ `tdate` date NOT NULL,
|
|
|
|
|
+ `user_name` varchar(50) NOT NULL,
|
|
|
|
|
+ `uid` int(11) NOT NULL DEFAULT '0',
|
|
|
|
|
+ `agent_id` int(11) NOT NULL DEFAULT '0',
|
|
|
|
|
+ `site_id` int(11) NOT NULL DEFAULT '0',
|
|
|
|
|
+ `game_id` int(11) NOT NULL DEFAULT '0',
|
|
|
|
|
+ `active` int(11) NOT NULL DEFAULT '0' COMMENT '(登录减注册的天数)',
|
|
|
|
|
+ PRIMARY KEY (`id`),
|
|
|
|
|
+ UNIQUE KEY `tdate_2` (`game_id`,`tdate`,`uid`),
|
|
|
|
|
+ KEY `tdate` (`tdate`),
|
|
|
|
|
+ KEY `user_name` (`user_name`),
|
|
|
|
|
+ KEY `uid` (`uid`),
|
|
|
|
|
+ KEY `game_id` (`game_id`),
|
|
|
|
|
+ KEY `agent_id` (`agent_id`),
|
|
|
|
|
+ KEY `site_id` (`site_id`),
|
|
|
|
|
+ KEY `active` (`active`)
|
|
|
|
|
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户活跃表';";
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ protected string $sdk_reg_log = "CREATE TABLE IF NOT EXISTS `sdk_reg_log_{{MONTH}}` (
|
|
|
|
|
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
|
+ `user_name` varchar(20) DEFAULT '',
|
|
|
|
|
+ `uid` bigint(20) NOT NULL DEFAULT '0',
|
|
|
|
|
+ `game_id` int(11) NOT NULL COMMENT '游戏game_id',
|
|
|
`media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
|
|
`media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
|
|
|
- `agent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '渠道ID',
|
|
|
|
|
- `site_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告位ID',
|
|
|
|
|
- `auth_id` int(10) NOT NULL DEFAULT '0' COMMENT '负责人ID',
|
|
|
|
|
- `server_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '区服ID',
|
|
|
|
|
- `user_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登陆用户数(数据上报)',
|
|
|
|
|
- `new_user_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新登陆用户(进入游戏)',
|
|
|
|
|
- `reg_user_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册登陆数(数据上报)',
|
|
|
|
|
- `role_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏角色登陆数',
|
|
|
|
|
- `role_create_user` int(10) unsigned DEFAULT '0' COMMENT '创建角色用户数',
|
|
|
|
|
- `role_create_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏创角数',
|
|
|
|
|
- `pay_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '充值人数',
|
|
|
|
|
- `pay_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '充值金额',
|
|
|
|
|
- `reg_pay_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册付费人数',
|
|
|
|
|
- `reg_pay_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册付费金额',
|
|
|
|
|
- `gf_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '衮服登陆用户数',
|
|
|
|
|
- `gf_pay_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '衮服付费数',
|
|
|
|
|
- `gf_pay_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '衮服付费金额',
|
|
|
|
|
- PRIMARY KEY (`id`) USING BTREE,
|
|
|
|
|
- UNIQUE KEY `select_index` (`tdate`,`agent_id`,`site_id`,`game_id`,`server_id`) USING BTREE,
|
|
|
|
|
- KEY `tdate` (`tdate`) USING BTREE,
|
|
|
|
|
- KEY `agent_id` (`agent_id`) USING BTREE,
|
|
|
|
|
- KEY `site_id` (`site_id`) USING BTREE,
|
|
|
|
|
- KEY `game_id` (`game_id`) USING BTREE,
|
|
|
|
|
- KEY `media_id` (`media_id`) USING BTREE,
|
|
|
|
|
- KEY `auth_id` (`auth_id`) USING BTREE,
|
|
|
|
|
- KEY `server_id` (`server_id`) USING BTREE
|
|
|
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='按区服统计总表';";
|
|
|
|
|
- protected string $server_total_hour = "CREATE TABLE IF NOT EXISTS `server_total_hour_{{MONTH}}` (
|
|
|
|
|
- `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
|
- `tdate` date NOT NULL COMMENT '日期',
|
|
|
|
|
- `thour` tinyint(4) NOT NULL COMMENT '小时',
|
|
|
|
|
- `game_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏ID',
|
|
|
|
|
|
|
+ `agent_id` int(10) unsigned NOT NULL DEFAULT '1000' COMMENT '渠道id',
|
|
|
|
|
+ `site_id` int(10) unsigned NOT NULL DEFAULT '1000' COMMENT '广告位id',
|
|
|
|
|
+ `auth_id` int(11) NOT NULL DEFAULT '0' COMMENT '负责人ID',
|
|
|
|
|
+ `reg_time` int(11) NOT NULL,
|
|
|
|
|
+ `imei` varchar(64) DEFAULT '' COMMENT 'imei/idfa',
|
|
|
|
|
+ `oaid` varchar(128) DEFAULT '' COMMENT 'oaid/cid',
|
|
|
|
|
+ `ip` varchar(128) NOT NULL DEFAULT '',
|
|
|
|
|
+ `vt` tinyint(4) NOT NULL DEFAULT '1' COMMENT '0:模拟器1:真机2:未知',
|
|
|
|
|
+ `cpu` varchar(32) DEFAULT '' COMMENT 'cpu',
|
|
|
|
|
+ `brand` varchar(32) DEFAULT '' COMMENT '品牌',
|
|
|
|
|
+ `model` varchar(32) DEFAULT '' COMMENT '机型',
|
|
|
|
|
+ `system_version` varchar(32) DEFAULT '' COMMENT '系统版本',
|
|
|
|
|
+ `sdk_version` varchar(32) DEFAULT '' COMMENT 'sdk版本',
|
|
|
|
|
+ `packname` varchar(64) DEFAULT '' COMMENT '包名',
|
|
|
|
|
+ `os` varchar(10) NOT NULL DEFAULT 'android',
|
|
|
|
|
+ PRIMARY KEY (`id`),
|
|
|
|
|
+ UNIQUE KEY `user_name` (`user_name`),
|
|
|
|
|
+ KEY `imei` (`imei`),
|
|
|
|
|
+ KEY `reg_time` (`reg_time`),
|
|
|
|
|
+ KEY `agent_id` (`agent_id`),
|
|
|
|
|
+ KEY `game_id` (`game_id`),
|
|
|
|
|
+ KEY `site_id` (`site_id`)
|
|
|
|
|
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='注册日志';";
|
|
|
|
|
+
|
|
|
|
|
+ protected string $sdk_login_log = "CREATE TABLE IF NOT EXISTS `sdk_login_log_{{MONTH}}` (
|
|
|
|
|
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
|
+ `user_name` varchar(20) DEFAULT '',
|
|
|
|
|
+ `uid` bigint(20) NOT NULL DEFAULT '0',
|
|
|
|
|
+ `game_id` int(11) NOT NULL COMMENT '游戏game_id',
|
|
|
`media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
|
|
`media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
|
|
|
- `agent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '渠道ID',
|
|
|
|
|
- `site_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告位ID',
|
|
|
|
|
- `auth_id` int(10) NOT NULL DEFAULT '0' COMMENT '负责人ID',
|
|
|
|
|
- `server_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '区服ID',
|
|
|
|
|
- `user_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登陆用户数(数据上报)',
|
|
|
|
|
- `new_user_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新登陆用户(进入游戏)',
|
|
|
|
|
- `reg_user_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册登陆数(数据上报)',
|
|
|
|
|
- `role_login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏角色登陆数',
|
|
|
|
|
- `role_create_user` int(10) unsigned DEFAULT '0' COMMENT '创建角色用户数',
|
|
|
|
|
- `role_create_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游戏创角数',
|
|
|
|
|
- `pay_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '充值人数',
|
|
|
|
|
- `pay_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '充值金额',
|
|
|
|
|
- PRIMARY KEY (`id`) USING BTREE,
|
|
|
|
|
- UNIQUE KEY `select_index` (`tdate`,`thour`,`agent_id`,`site_id`,`game_id`,`server_id`) USING BTREE,
|
|
|
|
|
- KEY `tdate` (`tdate`) USING BTREE,
|
|
|
|
|
- KEY `thour` (`thour`) USING BTREE,
|
|
|
|
|
- KEY `agent_id` (`agent_id`) USING BTREE,
|
|
|
|
|
- KEY `site_id` (`site_id`) USING BTREE,
|
|
|
|
|
- KEY `game_id` (`game_id`) USING BTREE,
|
|
|
|
|
- KEY `media_id` (`media_id`) USING BTREE,
|
|
|
|
|
- KEY `auth_id` (`auth_id`) USING BTREE,
|
|
|
|
|
- KEY `server_id` (`server_id`) USING BTREE
|
|
|
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='按区服统计小时总表';";
|
|
|
|
|
|
|
+ `agent_id` int(10) unsigned NOT NULL DEFAULT '1000' COMMENT '渠道id',
|
|
|
|
|
+ `site_id` int(10) unsigned NOT NULL DEFAULT '1000' COMMENT '广告位id',
|
|
|
|
|
+ `auth_id` int(11) NOT NULL DEFAULT '0' COMMENT '负责人ID',
|
|
|
|
|
+ `ip` varchar(128) NOT NULL DEFAULT '',
|
|
|
|
|
+ `login_time` int(10) unsigned NOT NULL,
|
|
|
|
|
+ `reg_time` int(10) unsigned NOT NULL,
|
|
|
|
|
+ `imei` varchar(64) DEFAULT '' COMMENT 'imei/idfa',
|
|
|
|
|
+ `oaid` varchar(128) DEFAULT '' COMMENT 'oaid/cid',
|
|
|
|
|
+ `vt` tinyint(4) NOT NULL DEFAULT '1' COMMENT '0:模拟器1:真机2:未知',
|
|
|
|
|
+ `brand` varchar(32) DEFAULT '' COMMENT '品牌',
|
|
|
|
|
+ `model` varchar(32) DEFAULT '' COMMENT '机型',
|
|
|
|
|
+ `system_version` varchar(32) DEFAULT '' COMMENT '系统版本',
|
|
|
|
|
+ `sdk_version` varchar(32) DEFAULT '' COMMENT 'sdk版本',
|
|
|
|
|
+ `packname` varchar(64) DEFAULT '' COMMENT '包名',
|
|
|
|
|
+ PRIMARY KEY (`id`),
|
|
|
|
|
+ KEY `user_name` (`user_name`),
|
|
|
|
|
+ KEY `agent_id` (`agent_id`),
|
|
|
|
|
+ KEY `game_id` (`game_id`),
|
|
|
|
|
+ KEY `ip` (`ip`),
|
|
|
|
|
+ KEY `login_time` (`login_time`),
|
|
|
|
|
+ KEY `reg_time` (`reg_time`)
|
|
|
|
|
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='登录日志';";
|
|
|
|
|
+
|
|
|
|
|
+ protected string $role_log = "CREATE TABLE IF NOT EXISTS `role_log_{{MONTH}}` (
|
|
|
|
|
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
|
+ `game_id` int(11) NOT NULL COMMENT '游戏game_id',
|
|
|
|
|
+ `media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
|
|
|
|
|
+ `agent_id` int(10) unsigned NOT NULL DEFAULT '1000' COMMENT '渠道id',
|
|
|
|
|
+ `site_id` int(10) unsigned NOT NULL DEFAULT '1000' COMMENT '广告位id',
|
|
|
|
|
+ `auth_id` int(11) NOT NULL DEFAULT '0' COMMENT '负责人ID',
|
|
|
|
|
+ `data_type` tinyint(4) NOT NULL COMMENT '调用时机:1选服 2创角 3进入 4升级 5退出',
|
|
|
|
|
+ `server_id` int(11) NOT NULL COMMENT '服务器ID',
|
|
|
|
|
+ `server_name` varchar(15) NOT NULL COMMENT '服务器名称',
|
|
|
|
|
+ `user_name` varchar(30) NOT NULL COMMENT '用户账号',
|
|
|
|
|
+ `uid` bigint(20) NOT NULL COMMENT '用户ID',
|
|
|
|
|
+ `role_id` varchar(64) NOT NULL COMMENT '角色ID',
|
|
|
|
|
+ `role_name` varchar(64) NOT NULL COMMENT '角色名',
|
|
|
|
|
+ `role_level` int(11) NOT NULL COMMENT '角色等级',
|
|
|
|
|
+ `ip` varchar(128) NOT NULL COMMENT 'IP',
|
|
|
|
|
+ `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
|
|
|
|
|
+ PRIMARY KEY (`id`),
|
|
|
|
|
+ KEY `game_id` (`game_id`),
|
|
|
|
|
+ KEY `user_name` (`user_name`),
|
|
|
|
|
+ KEY `uid` (`uid`),
|
|
|
|
|
+ KEY `data_type` (`data_type`),
|
|
|
|
|
+ KEY `role_id` (`role_id`),
|
|
|
|
|
+ KEY `agent_id` (`agent_id`),
|
|
|
|
|
+ KEY `site_id` (`site_id`)
|
|
|
|
|
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色日志';";
|
|
|
|
|
+
|
|
|
|
|
+ protected string $sdk_order = "CREATE TABLE IF NOT EXISTS `sdk_order_{{MONTH}}` (
|
|
|
|
|
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
|
|
|
|
|
+ `orderid` varchar(60) NOT NULL COMMENT '我方订单号',
|
|
|
|
|
+ `tradeid` varchar(60) DEFAULT '' COMMENT '交易流水号',
|
|
|
|
|
+ `cp_orderid` varchar(60) NOT NULL COMMENT '研发订单号',
|
|
|
|
|
+ `ext` varchar(200) DEFAULT NULL COMMENT 'CP扩展参数',
|
|
|
|
|
+ `pay_channel` smallint(6) NOT NULL,
|
|
|
|
|
+ `money` float NOT NULL COMMENT '面额(元)',
|
|
|
|
|
+ `paid_amount` float unsigned NOT NULL COMMENT '净额(元)',
|
|
|
|
|
+ `game_id` int(11) NOT NULL DEFAULT '0',
|
|
|
|
|
+ `media_id` int(11) NOT NULL DEFAULT '0' COMMENT '媒体ID',
|
|
|
|
|
+ `auth_id` int(11) NOT NULL DEFAULT '0' COMMENT '负责人ID',
|
|
|
|
|
+ `agent_id` int(11) NOT NULL DEFAULT '0',
|
|
|
|
|
+ `site_id` int(11) NOT NULL DEFAULT '0',
|
|
|
|
|
+ `uid` int(11) NOT NULL,
|
|
|
|
|
+ `user_name` varchar(30) NOT NULL,
|
|
|
|
|
+ `user_ip` varchar(128) NOT NULL DEFAULT '' COMMENT '用户IP',
|
|
|
|
|
+ `server_id` int(11) NOT NULL,
|
|
|
|
|
+ `server_name` varchar(20) DEFAULT '',
|
|
|
|
|
+ `role_id` varchar(32) DEFAULT '',
|
|
|
|
|
+ `role_name` varchar(32) DEFAULT '',
|
|
|
|
|
+ `payname` varchar(50) DEFAULT '',
|
|
|
|
|
+ `pay_date` datetime NOT NULL COMMENT '支付时间',
|
|
|
|
|
+ `sync_date` datetime DEFAULT NULL COMMENT '支付通知时间',
|
|
|
|
|
+ `sync_data` text COMMENT '支付回调信息',
|
|
|
|
|
+ `sync_result` varchar(200) DEFAULT '' COMMENT '第三方支付返回值',
|
|
|
|
|
+ `sync_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '支付回调状态 0未支付, 1已支付, 2异常回调',
|
|
|
|
|
+ `send_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '发货状态 0未发货, 1已发货',
|
|
|
|
|
+ `other_data` varchar(1000) DEFAULT '' COMMENT '其他数据',
|
|
|
|
|
+ `imei` varchar(64) DEFAULT '' COMMENT 'imei/idfa',
|
|
|
|
|
+ `oaid` varchar(128) DEFAULT '' COMMENT 'oaid/cid',
|
|
|
|
|
+ `model` varchar(32) DEFAULT '' COMMENT '手机型号',
|
|
|
|
|
+ `system_version` varchar(32) DEFAULT '' COMMENT '系统版本',
|
|
|
|
|
+ `sdk_version` varchar(32) DEFAULT '' COMMENT 'SDK版本',
|
|
|
|
|
+ `product_id` varchar(64) DEFAULT NULL COMMENT '充值商品ID',
|
|
|
|
|
+ `product_name` varchar(64) DEFAULT NULL COMMENT '充值商品名',
|
|
|
|
|
+ PRIMARY KEY (`id`),
|
|
|
|
|
+ UNIQUE KEY `orderid` (`orderid`),
|
|
|
|
|
+ KEY `uid` (`uid`),
|
|
|
|
|
+ KEY `user_name` (`user_name`),
|
|
|
|
|
+ KEY `tradeid` (`tradeid`),
|
|
|
|
|
+ KEY `cp_orderid` (`cp_orderid`),
|
|
|
|
|
+ KEY `game_id` (`game_id`),
|
|
|
|
|
+ KEY `sync_status` (`sync_status`),
|
|
|
|
|
+ KEY `send_status` (`send_status`),
|
|
|
|
|
+ KEY `auth_id` (`auth_id`),
|
|
|
|
|
+ KEY `role_id` (`role_id`)
|
|
|
|
|
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单记录表';";
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|