DROP TABLE IF EXISTS `dw_ltv_agent`;
CREATE TABLE `dw_ltv_agent` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `date` date NOT NULL COMMENT '日期',
    `agent_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '代理ID',
    `ads_id` smallint(3) unsigned NOT NULL DEFAULT '0' COMMENT '1 CPA 2 CPS 3 CPC',
    `costs` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '花费',
    `reg_cnt` int(11) NOT NULL DEFAULT '0' COMMENT '注册玩家数',
    `reg_device_cnt` int(11) NOT NULL DEFAULT '0' COMMENT '新增设备数',
    `sum_money` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '充值金额',
    `day1` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '1日充值金额',
    `day2` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '2日充值金额',
    `day3` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '3日充值金额',
    `day4` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '4日充值金额',
    `day5` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '5日充值金额',
    `day6` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '6日充值金额',
    `day7` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '7日充值金额',
    `day8` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '8日充值金额',
    `day9` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '9日充值金额',
    `day10` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '10日充值金额',
    `day11` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '11日充值金额',
    `day12` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '12日充值金额',
    `day13` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '13日充值金额',
    `day14` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '14日充值金额',
    `day15` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '15日充值金额',
    `day16` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '16日充值金额',
    `day17` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '17日充值金额',
    `day18` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '18日充值金额',
    `day19` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '19日充值金额',
    `day20` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '20日充值金额',
    `day21` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '21日充值金额',
    `day22` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '22日充值金额',
    `day23` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '23日充值金额',
    `day24` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '24日充值金额',
    `day25` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '25日充值金额',
    `day26` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '26日充值金额',
    `day27` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '27日充值金额',
    `day28` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '28日充值金额',
    `day29` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '29日充值金额',
    `day30` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '30日充值金额',
    `day31` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '31日充值金额',
    `day32` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '32日充值金额',
    `day33` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '33日充值金额',
    `day34` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '34日充值金额',
    `day35` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '35日充值金额',
    `day36` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '36日充值金额',
    `day37` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '37日充值金额',
    `day38` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '38日充值金额',
    `day39` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '39日充值金额',
    `day40` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '40日充值金额',
    `day41` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '41日充值金额',
    `day42` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '42日充值金额',
    `day43` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '43日充值金额',
    `day44` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '44日充值金额',
    `day45` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '45日充值金额',
    `day46` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '46日充值金额',
    `day47` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '47日充值金额',
    `day48` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '48日充值金额',
    `day49` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '49日充值金额',
    `day50` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '50日充值金额',
    `day51` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '51日充值金额',
    `day52` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '52日充值金额',
    `day53` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '53日充值金额',
    `day54` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '54日充值金额',
    `day55` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '55日充值金额',
    `day56` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '56日充值金额',
    `day57` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '57日充值金额',
    `day58` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '58日充值金额',
    `day59` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '59日充值金额',
    `day60` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '60日充值金额',
    `day90` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至90日充值金额',
    `day120` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至120日充值金额',
    `day180` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至180日充值金额',
    `day270` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至270日充值金额',
    `day360` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至360日充值金额',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE KEY `lga_date_agent_unique` (`date`,`agent_id`) USING BTREE,
    KEY `lga_agent_index` (`agent_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='每日渠道LTV统计表';

DROP TABLE IF EXISTS `dw_ltv_day`;
CREATE TABLE `dw_ltv_day` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `date` date NOT NULL COMMENT '日期',
    `costs` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '花费',
    `reg_cnt` int(11) NOT NULL DEFAULT '0' COMMENT '注册玩家数',
    `reg_device_cnt` int(11) NOT NULL DEFAULT '0' COMMENT '新增设备数',
    `sum_money` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '充值金额',
    `day1` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '1日充值金额',
    `day2` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '2日充值金额',
    `day3` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '3日充值金额',
    `day4` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '4日充值金额',
    `day5` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '5日充值金额',
    `day6` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '6日充值金额',
    `day7` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '7日充值金额',
    `day8` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '8日充值金额',
    `day9` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '9日充值金额',
    `day10` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '10日充值金额',
    `day11` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '11日充值金额',
    `day12` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '12日充值金额',
    `day13` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '13日充值金额',
    `day14` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '14日充值金额',
    `day15` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '15日充值金额',
    `day16` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '16日充值金额',
    `day17` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '17日充值金额',
    `day18` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '18日充值金额',
    `day19` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '19日充值金额',
    `day20` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '20日充值金额',
    `day21` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '21日充值金额',
    `day22` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '22日充值金额',
    `day23` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '23日充值金额',
    `day24` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '24日充值金额',
    `day25` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '25日充值金额',
    `day26` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '26日充值金额',
    `day27` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '27日充值金额',
    `day28` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '28日充值金额',
    `day29` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '29日充值金额',
    `day30` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '30日充值金额',
    `day31` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '31日充值金额',
    `day32` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '32日充值金额',
    `day33` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '33日充值金额',
    `day34` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '34日充值金额',
    `day35` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '35日充值金额',
    `day36` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '36日充值金额',
    `day37` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '37日充值金额',
    `day38` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '38日充值金额',
    `day39` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '39日充值金额',
    `day40` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '40日充值金额',
    `day41` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '41日充值金额',
    `day42` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '42日充值金额',
    `day43` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '43日充值金额',
    `day44` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '44日充值金额',
    `day45` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '45日充值金额',
    `day46` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '46日充值金额',
    `day47` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '47日充值金额',
    `day48` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '48日充值金额',
    `day49` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '49日充值金额',
    `day50` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '50日充值金额',
    `day51` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '51日充值金额',
    `day52` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '52日充值金额',
    `day53` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '53日充值金额',
    `day54` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '54日充值金额',
    `day55` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '55日充值金额',
    `day56` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '56日充值金额',
    `day57` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '57日充值金额',
    `day58` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '58日充值金额',
    `day59` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '59日充值金额',
    `day60` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '60日充值金额',
    `day90` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至90日充值金额',
    `day120` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至120日充值金额',
    `day180` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至180日充值金额',
    `day270` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至270日充值金额',
    `day360` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至360日充值金额',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE KEY `ld_date_unique` (`date`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='每日LTV统计表';

DROP TABLE IF EXISTS `dw_ltv_game`;
CREATE TABLE `dw_ltv_game` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `date` date NOT NULL COMMENT '日期',
    `app_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '游戏ID',
    `costs` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '花费',
    `reg_cnt` int(11) NOT NULL DEFAULT '0' COMMENT '注册玩家数',
    `reg_device_cnt` int(11) NOT NULL DEFAULT '0' COMMENT '新增设备数',
    `sum_money` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '充值金额',
    `day1` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '1日充值金额',
    `day2` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '2日充值金额',
    `day3` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '3日充值金额',
    `day4` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '4日充值金额',
    `day5` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '5日充值金额',
    `day6` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '6日充值金额',
    `day7` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '7日充值金额',
    `day8` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '8日充值金额',
    `day9` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '9日充值金额',
    `day10` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '10日充值金额',
    `day11` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '11日充值金额',
    `day12` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '12日充值金额',
    `day13` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '13日充值金额',
    `day14` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '14日充值金额',
    `day15` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '15日充值金额',
    `day16` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '16日充值金额',
    `day17` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '17日充值金额',
    `day18` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '18日充值金额',
    `day19` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '19日充值金额',
    `day20` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '20日充值金额',
    `day21` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '21日充值金额',
    `day22` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '22日充值金额',
    `day23` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '23日充值金额',
    `day24` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '24日充值金额',
    `day25` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '25日充值金额',
    `day26` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '26日充值金额',
    `day27` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '27日充值金额',
    `day28` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '28日充值金额',
    `day29` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '29日充值金额',
    `day30` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '30日充值金额',
    `day31` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '31日充值金额',
    `day32` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '32日充值金额',
    `day33` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '33日充值金额',
    `day34` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '34日充值金额',
    `day35` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '35日充值金额',
    `day36` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '36日充值金额',
    `day37` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '37日充值金额',
    `day38` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '38日充值金额',
    `day39` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '39日充值金额',
    `day40` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '40日充值金额',
    `day41` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '41日充值金额',
    `day42` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '42日充值金额',
    `day43` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '43日充值金额',
    `day44` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '44日充值金额',
    `day45` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '45日充值金额',
    `day46` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '46日充值金额',
    `day47` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '47日充值金额',
    `day48` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '48日充值金额',
    `day49` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '49日充值金额',
    `day50` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '50日充值金额',
    `day51` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '51日充值金额',
    `day52` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '52日充值金额',
    `day53` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '53日充值金额',
    `day54` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '54日充值金额',
    `day55` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '55日充值金额',
    `day56` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '56日充值金额',
    `day57` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '57日充值金额',
    `day58` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '58日充值金额',
    `day59` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '59日充值金额',
    `day60` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '60日充值金额',
    `day90` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至90日充值金额',
    `day120` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至120日充值金额',
    `day180` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至180日充值金额',
    `day270` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至270日充值金额',
    `day360` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至360日充值金额',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE KEY `lg_date_game_unique` (`date`,`app_id`) USING BTREE,
    KEY `lga_game_index` (`app_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='每日游戏LTV统计表';

DROP TABLE IF EXISTS `dw_ltv_game_agent`;
CREATE TABLE `dw_ltv_game_agent` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `date` date NOT NULL COMMENT '日期',
    `app_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '游戏ID',
    `agent_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '代理ID',
    `ads_id` smallint(3) unsigned NOT NULL DEFAULT '0' COMMENT '1 CPA 2 CPS 3 CPC',
    `costs` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '花费',
    `reg_cnt` int(11) NOT NULL DEFAULT '0' COMMENT '注册玩家数',
    `reg_device_cnt` int(11) NOT NULL DEFAULT '0' COMMENT '新增设备数',
    `sum_money` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '充值金额',
    `day1` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '1日充值金额',
    `day2` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '2日充值金额',
    `day3` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '3日充值金额',
    `day4` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '4日充值金额',
    `day5` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '5日充值金额',
    `day6` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '6日充值金额',
    `day7` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '7日充值金额',
    `day8` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '8日充值金额',
    `day9` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '9日充值金额',
    `day10` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '10日充值金额',
    `day11` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '11日充值金额',
    `day12` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '12日充值金额',
    `day13` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '13日充值金额',
    `day14` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '14日充值金额',
    `day15` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '15日充值金额',
    `day16` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '16日充值金额',
    `day17` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '17日充值金额',
    `day18` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '18日充值金额',
    `day19` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '19日充值金额',
    `day20` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '20日充值金额',
    `day21` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '21日充值金额',
    `day22` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '22日充值金额',
    `day23` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '23日充值金额',
    `day24` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '24日充值金额',
    `day25` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '25日充值金额',
    `day26` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '26日充值金额',
    `day27` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '27日充值金额',
    `day28` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '28日充值金额',
    `day29` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '29日充值金额',
    `day30` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '30日充值金额',
    `day31` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '31日充值金额',
    `day32` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '32日充值金额',
    `day33` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '33日充值金额',
    `day34` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '34日充值金额',
    `day35` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '35日充值金额',
    `day36` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '36日充值金额',
    `day37` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '37日充值金额',
    `day38` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '38日充值金额',
    `day39` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '39日充值金额',
    `day40` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '40日充值金额',
    `day41` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '41日充值金额',
    `day42` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '42日充值金额',
    `day43` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '43日充值金额',
    `day44` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '44日充值金额',
    `day45` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '45日充值金额',
    `day46` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '46日充值金额',
    `day47` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '47日充值金额',
    `day48` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '48日充值金额',
    `day49` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '49日充值金额',
    `day50` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '50日充值金额',
    `day51` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '51日充值金额',
    `day52` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '52日充值金额',
    `day53` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '53日充值金额',
    `day54` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '54日充值金额',
    `day55` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '55日充值金额',
    `day56` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '56日充值金额',
    `day57` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '57日充值金额',
    `day58` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '58日充值金额',
    `day59` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '59日充值金额',
    `day60` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '60日充值金额',
    `day90` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至90日充值金额',
    `day120` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至120日充值金额',
    `day180` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至180日充值金额',
    `day270` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至270日充值金额',
    `day360` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '至360日充值金额',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE KEY `lga_date_game_agent_unique` (`date`,`app_id`,`agent_id`) USING BTREE,
    KEY `lga_game_index` (`app_id`) USING BTREE,
    KEY `lga_agent_index` (`agent_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='每日渠道游戏LTV统计表';