|
@@ -230,7 +230,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
{
|
|
{
|
|
|
$params = $this->searchByAuth($where);
|
|
$params = $this->searchByAuth($where);
|
|
|
// 忽略 0 投入
|
|
// 忽略 0 投入
|
|
|
- $igz = !empty($params['igz']) ? $params['igz'] : '';
|
|
|
|
|
|
|
+ $igz = !empty($params['filter']) && is_array($params['filter']) && in_array('igz', $params['filter']);
|
|
|
$group = !empty($params['group']) ? $params['group'] : '';
|
|
$group = !empty($params['group']) ? $params['group'] : '';
|
|
|
|
|
|
|
|
// 如果分组按照 游戏组ID||游戏组
|
|
// 如果分组按照 游戏组ID||游戏组
|
|
@@ -283,8 +283,8 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
game_id,
|
|
game_id,
|
|
|
agent_id";
|
|
agent_id";
|
|
|
$activeData = $this->generateUnionList('game_active_day', $yearRange, $activeWhereRaw, $activeField, $type);
|
|
$activeData = $this->generateUnionList('game_active_day', $yearRange, $activeWhereRaw, $activeField, $type);
|
|
|
- $activeData = array_column($activeData, 'active', $type);
|
|
|
|
|
|
|
|
|
|
|
|
+ $activeData = $activeData ? array_column($activeData, 'active', $type) : [];
|
|
|
|
|
|
|
|
// 4. 注册充值统计
|
|
// 4. 注册充值统计
|
|
|
$regPayWhereRaw = $whereRaw;
|
|
$regPayWhereRaw = $whereRaw;
|
|
@@ -554,7 +554,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
if (empty($params['agent_id'])) {
|
|
if (empty($params['agent_id'])) {
|
|
|
$params['agent_id'] = 0;
|
|
$params['agent_id'] = 0;
|
|
|
}
|
|
}
|
|
|
- $groupBy = 'site_id,media_id';
|
|
|
|
|
|
|
+ $groupBy = 'auth_id,media_id,agent_id,site_id';
|
|
|
$whereRaw = $this->getCommonWhereRaw($params);
|
|
$whereRaw = $this->getCommonWhereRaw($params);
|
|
|
|
|
|
|
|
// 支出数据
|
|
// 支出数据
|
|
@@ -563,35 +563,33 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
|
|
|
|
|
// base统计数据(展示IP(ad_show_ip)、激活(install)、注册设备(reg_dev)、注册数(reg_total)、创角数(role_total)、老用户(old_login_total)、注册付费人数(reg_pay_num)、当天注册付费金额(reg_pay_total_da)、付费总金额(pay_total)、付费总人数(pay_num))
|
|
// base统计数据(展示IP(ad_show_ip)、激活(install)、注册设备(reg_dev)、注册数(reg_total)、创角数(role_total)、老用户(old_login_total)、注册付费人数(reg_pay_num)、当天注册付费金额(reg_pay_total_da)、付费总金额(pay_total)、付费总人数(pay_num))
|
|
|
$baseTotalField = "
|
|
$baseTotalField = "
|
|
|
|
|
+ {$groupBy},
|
|
|
SUM(ad_show_ip) AS ad_show_ip,
|
|
SUM(ad_show_ip) AS ad_show_ip,
|
|
|
SUM(install) AS install,
|
|
SUM(install) AS install,
|
|
|
SUM(reg_dev) AS reg_dev,
|
|
SUM(reg_dev) AS reg_dev,
|
|
|
SUM(reg_total) AS reg_total,
|
|
SUM(reg_total) AS reg_total,
|
|
|
SUM(role_create_user) AS role_total,
|
|
SUM(role_create_user) AS role_total,
|
|
|
SUM(old_login_total) AS old_login_total,
|
|
SUM(old_login_total) AS old_login_total,
|
|
|
- SUM(reg_pay_total) AS reg_pay_total_da,
|
|
|
|
|
- site_id,
|
|
|
|
|
- media_id,
|
|
|
|
|
- agent_id,
|
|
|
|
|
- auth_id";
|
|
|
|
|
|
|
+ SUM(reg_pay_total) AS reg_pay_total_da";
|
|
|
$yearRange = getYearRange($params['tdate'][0], $params['tdate'][1]);
|
|
$yearRange = getYearRange($params['tdate'][0], $params['tdate'][1]);
|
|
|
$baseTotalDayData = $this->generateUnionList('base_total_day', $yearRange, $whereRaw, $baseTotalField, $groupBy);
|
|
$baseTotalDayData = $this->generateUnionList('base_total_day', $yearRange, $whereRaw, $baseTotalField, $groupBy);
|
|
|
|
|
|
|
|
// active 活跃数,次留人数
|
|
// active 活跃数,次留人数
|
|
|
$activeWhereRaw = $whereRaw . ' AND days = 1';
|
|
$activeWhereRaw = $whereRaw . ' AND days = 1';
|
|
|
$activeWhereRaw = str_replace('tdate', 'reg_date', $activeWhereRaw);
|
|
$activeWhereRaw = str_replace('tdate', 'reg_date', $activeWhereRaw);
|
|
|
- $activeField = " sum(active_total) as active, site_id";
|
|
|
|
|
|
|
+ $activeField = " {$groupBy}, sum(active_total) as active";
|
|
|
|
|
|
|
|
$activeData = $this->generateUnionList('game_active_day', $yearRange, $activeWhereRaw, $activeField, $groupBy);
|
|
$activeData = $this->generateUnionList('game_active_day', $yearRange, $activeWhereRaw, $activeField, $groupBy);
|
|
|
|
|
+
|
|
|
$activeData = array_column($activeData, 'active', 'site_id');
|
|
$activeData = array_column($activeData, 'active', 'site_id');
|
|
|
|
|
|
|
|
// 注册充值统计(累计充值reg_pay_total, 注册总充值(扣除分成)reg_pay_amount、注册累计付费人数(reg_pay_num))
|
|
// 注册充值统计(累计充值reg_pay_total, 注册总充值(扣除分成)reg_pay_amount、注册累计付费人数(reg_pay_num))
|
|
|
$regPayWhereRaw = $whereRaw;
|
|
$regPayWhereRaw = $whereRaw;
|
|
|
$regPayField = "
|
|
$regPayField = "
|
|
|
|
|
+ {$groupBy},
|
|
|
sum(addup_pay_num) as reg_pay_num,
|
|
sum(addup_pay_num) as reg_pay_num,
|
|
|
sum(addup_pay_total) as reg_pay_total,
|
|
sum(addup_pay_total) as reg_pay_total,
|
|
|
- sum(addup_pay_amount) as reg_pay_amount,
|
|
|
|
|
- site_id";
|
|
|
|
|
|
|
+ sum(addup_pay_amount) as reg_pay_amount";
|
|
|
$regPayWhereRaw = str_replace('tdate', 'reg_date', $regPayWhereRaw);
|
|
$regPayWhereRaw = str_replace('tdate', 'reg_date', $regPayWhereRaw);
|
|
|
$regPayData = $this->generateUnionList('game_reg_pay_day', $yearRange, $regPayWhereRaw, $regPayField, $groupBy);
|
|
$regPayData = $this->generateUnionList('game_reg_pay_day', $yearRange, $regPayWhereRaw, $regPayField, $groupBy);
|
|
|
|
|
|