|
|
@@ -26,14 +26,14 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
SUM(reg_pay_num_rg) as reg_pay_num_rg,
|
|
|
SUM(reg_pay_total_rg) as reg_pay_total_rg";
|
|
|
$group = 'agent_id,thour';
|
|
|
- $whereSql = $this->getCommonWhereRaw($params);
|
|
|
+ $whereRaw = $this->getCommonWhereRaw($params);
|
|
|
|
|
|
// 根据日期,连表查询
|
|
|
$monthRange = getMonthRange($params['reg_date'][0], $params['reg_date'][1]);
|
|
|
$sqlParts = [];
|
|
|
foreach ($monthRange as $month) {
|
|
|
$tableName = 'base_total_hour_' . $month;
|
|
|
- $sqlParts[] = "SELECT * FROM {$tableName} WHERE 1=1 {$whereSql}";
|
|
|
+ $sqlParts[] = "SELECT * FROM {$tableName} WHERE {$whereRaw}";
|
|
|
}
|
|
|
$unionSql = implode(" UNION ALL ", $sqlParts);
|
|
|
|
|
|
@@ -114,14 +114,14 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
{
|
|
|
$params = $this->searchByAuth($where);
|
|
|
|
|
|
- $whereSql = $this->getCommonWhereRaw($params);
|
|
|
+ $whereRaw = $this->getCommonWhereRaw($params);
|
|
|
|
|
|
// 1. 注册数据:$regData = 按照日期,获取每日的 注册数【reg_total】分组,base_total_day_2025
|
|
|
$yearRange = getYearRange($params['reg_date'][0], $params['reg_date'][1]);
|
|
|
$baseTotalDaySqlParts = [];
|
|
|
foreach ($yearRange as $year) {
|
|
|
$tableName = 'base_total_day_' . $year;
|
|
|
- $baseTotalDaySqlParts[] = "SELECT * FROM {$tableName} WHERE {$whereSql}";
|
|
|
+ $baseTotalDaySqlParts[] = "SELECT * FROM {$tableName} WHERE {$whereRaw}";
|
|
|
}
|
|
|
$unionBaseTotalDaySql = implode(" UNION ALL ", $baseTotalDaySqlParts);
|
|
|
// 按照每日,获取=>注册数据
|
|
|
@@ -135,7 +135,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
|
|
|
foreach ($yearRange as $year) {
|
|
|
$tableName = 'game_active_day_' . $year;
|
|
|
- $gameActiveDaySqlParts[] = "SELECT * FROM {$tableName} WHERE {$whereSql}";
|
|
|
+ $gameActiveDaySqlParts[] = "SELECT * FROM {$tableName} WHERE {$whereRaw}";
|
|
|
}
|
|
|
|
|
|
$unionGameActiveDaySql = implode(" UNION ALL ", $gameActiveDaySqlParts);
|
|
|
@@ -248,15 +248,15 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
$type = 'agent_id';
|
|
|
}
|
|
|
|
|
|
- $whereSql = $this->getCommonWhereRaw($params);
|
|
|
+ $whereRaw = $this->getCommonWhereRaw($params);
|
|
|
|
|
|
// 1.查询消耗数据, 安game_id/agent_id分组
|
|
|
// 忽略后台录入的消耗
|
|
|
- $costWhereSql = $whereSql;
|
|
|
+ $costWhereRaw = $whereRaw;
|
|
|
if (!empty($params['filter']) && is_array($params['filter']) && in_array('fak', $params['filter'])) {
|
|
|
- $costWhereSql .= " AND add_type = 0";
|
|
|
+ $costWhereRaw .= " AND add_type = 0";
|
|
|
}
|
|
|
- $costSql = "SELECT {$type}, SUM(money) as cost from media_cost WHERE 1=1 {$costWhereSql} GROUP BY {$type}";
|
|
|
+ $costSql = "SELECT {$type}, SUM(money) as cost from media_cost WHERE {$costWhereRaw} GROUP BY {$type}";
|
|
|
|
|
|
$costData = Db::connect('db_advert')->query($costSql);
|
|
|
$costDataColumn = array_column($costData, 'cost', $type);
|
|
|
@@ -275,31 +275,31 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
auth_id,
|
|
|
media_id
|
|
|
";
|
|
|
-
|
|
|
// 2. 获取基础报表数据,兼容跨年
|
|
|
- $baseData = $this->generateYearUnionList('base_total_day_', $params['reg_date'], $whereSql, $totalDayField, $type);
|
|
|
+ $yearRange = getYearRange($params['reg_date'][0], $params['reg_date'][1]);
|
|
|
+ $baseData = $this->generateUnionList('base_total_day', $yearRange, $whereRaw, $totalDayField, $type);
|
|
|
|
|
|
// 3. 获取活跃数
|
|
|
- $activeWhereSql = $whereSql . ' AND days = 1';
|
|
|
- $activeWhereSql = str_replace('tdate', 'reg_date', $activeWhereSql);
|
|
|
+ $activeWhereRaw = $whereRaw . ' AND days = 1';
|
|
|
+ $activeWhereRaw = str_replace('tdate', 'reg_date', $activeWhereRaw);
|
|
|
$activeField = "
|
|
|
sum(active_total) as active,
|
|
|
game_id,
|
|
|
agent_id";
|
|
|
- $activeData = $this->generateYearUnionList('game_active_day_', $params['reg_date'], $activeWhereSql, $activeField, $type);
|
|
|
+ $activeData = $this->generateUnionList('game_active_day', $yearRange, $activeWhereRaw, $activeField, $type);
|
|
|
$activeData = array_column($activeData, 'active', $type);
|
|
|
|
|
|
|
|
|
// 4. 注册充值统计
|
|
|
- $regPayWhereSql = $whereSql;
|
|
|
+ $regPayWhereRaw = $whereRaw;
|
|
|
$regPayField = "
|
|
|
sum(addup_pay_num) as reg_pay_num,
|
|
|
sum(addup_pay_total) as reg_pay_total,
|
|
|
sum(addup_pay_amount) as reg_pay_amount,
|
|
|
{$type}";
|
|
|
- $regPayWhereSql = str_replace('tdate', 'reg_date', $regPayWhereSql);
|
|
|
+ $regPayWhereRaw = str_replace('tdate', 'reg_date', $regPayWhereRaw);
|
|
|
|
|
|
- $regPayData = $this->generateYearUnionList('game_reg_pay_day_', $params['reg_date'], $regPayWhereSql, $regPayField, $type);
|
|
|
+ $regPayData = $this->generateUnionList('game_reg_pay_day', $yearRange, $regPayWhereRaw, $regPayField, $type);
|
|
|
$regPayData = array_column($regPayData, null, $type);
|
|
|
|
|
|
|
|
|
@@ -474,16 +474,11 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
$wherePay = $where;
|
|
|
unset($wherePay['reg_date']);
|
|
|
|
|
|
- $whereSql = $this->getCommonWhereRaw($wherePay);
|
|
|
- $whereSql = "{$whereSql} AND reg_date = '{$regDate}' AND pay_date = '{$eDate}'";
|
|
|
-
|
|
|
+ $whereRaw = $this->getCommonWhereRaw($wherePay);
|
|
|
+ $whereRaw = "{$whereRaw} AND reg_date = '{$regDate}' AND pay_date = '{$eDate}'";
|
|
|
|
|
|
- $payData = $this->generateYearUnionList('game_reg_pay_day_',
|
|
|
- [
|
|
|
- $regDate,
|
|
|
- $regDate
|
|
|
- ]
|
|
|
- , $whereSql, $field, $type);
|
|
|
+ $yearRange = getYearRange($regDate, $regDate);
|
|
|
+ $payData = $this->generateUnionList('game_reg_pay_day', $yearRange , $whereRaw, $field, $type);
|
|
|
|
|
|
$payDataAll = array_merge($payDataAll, $payData);
|
|
|
}
|
|
|
@@ -500,23 +495,24 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
*/
|
|
|
public function agentTotal($where)
|
|
|
{
|
|
|
- $whereSql = $this->getCommonWhereRaw($where);
|
|
|
+ $whereRaw = $this->getCommonWhereRaw($where);
|
|
|
|
|
|
// 1. 消耗表. 获取消耗金额
|
|
|
- $costData = Db::connect('db_advert')->query("SELECT SUM(money) as cost FROM media_cost WHERE 1=1 $whereSql");
|
|
|
+ $costData = Db::connect('db_advert')->query("SELECT SUM(money) as cost FROM media_cost WHERE {$whereRaw}");
|
|
|
$cost = $costData[0]['cost'] ?? 0;
|
|
|
|
|
|
// 2. base_total_day_ 获取注册数(reg_total)、注册付费金额(reg_pay_total)、
|
|
|
$baseTotalField = " SUM(reg_total) AS reg_total, SUM(reg_pay_total) AS reg_pay_total";
|
|
|
- $baseTotalDayData = $this->generateYearUnionList('base_total_day_', $where['reg_date'], $whereSql, $baseTotalField);
|
|
|
+ $yearRange = getYearRange($where['reg_date'][0], $where['reg_date'][1]);
|
|
|
+ $baseTotalDayData = $this->generateUnionList('base_total_day', $yearRange, $whereRaw, $baseTotalField);
|
|
|
|
|
|
$regTotal = $baseTotalDayData[0]['reg_total'] ?? 0;
|
|
|
$regPayTotal = $baseTotalDayData[0]['reg_pay_total'] ?? 0;
|
|
|
|
|
|
// 3. 注册付费表. 获取总付费人数(reg_pay_num)
|
|
|
$regPayField = "sum(addup_pay_num) as reg_pay_num";
|
|
|
- $regPayWhereSql = str_replace('tdate', 'reg_date', $whereSql);
|
|
|
- $regPayData = $this->generateYearUnionList('game_reg_pay_day_', $where['reg_date'], $regPayWhereSql, $regPayField);
|
|
|
+ $regPayWhereRaw = str_replace('tdate', 'reg_date', $whereRaw);
|
|
|
+ $regPayData = $this->generateUnionList('game_reg_pay_day', $yearRange, $regPayWhereRaw, $regPayField);
|
|
|
$regPayNum = $regPayData[0]['reg_pay_num'] ?? 0;
|
|
|
|
|
|
// roi
|
|
|
@@ -549,13 +545,13 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
|
|
|
// 根据渠道名称获取渠道ID
|
|
|
if (!empty($params['site_name'])) {
|
|
|
- $agentData = Db::connect('db_advert')->query("SELECT id,name FROM agent_list WHERE 1=1 AND name = '{$params['agent_name']}'");
|
|
|
+ $agentData = Db::connect('db_advert')->query("SELECT id,name FROM agent_list WHERE name = '{$params['agent_name']}'");
|
|
|
$params['agent_id'] = $agentData[0]['id'] ?? 0;
|
|
|
}
|
|
|
|
|
|
// 根据广告名称获取广告ID
|
|
|
if (!empty($params['site_name'])) {
|
|
|
- $mediaData = Db::connect('db_advert')->query("SELECT id,name FROM agent_site WHERE 1=1 AND name = '{$params['site_name']}'");
|
|
|
+ $mediaData = Db::connect('db_advert')->query("SELECT id,name FROM agent_site WHERE name = '{$params['site_name']}'");
|
|
|
$params['media_id'] = $mediaData[0]['id'] ?? 0;
|
|
|
}
|
|
|
|
|
|
@@ -563,11 +559,10 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
$params['agent_id'] = 0;
|
|
|
}
|
|
|
$groupBy = 'site_id,media_id';
|
|
|
- $whereSql = $this->getCommonWhereRaw($params);
|
|
|
+ $whereRaw = $this->getCommonWhereRaw($params);
|
|
|
|
|
|
// 支出数据
|
|
|
- $costWhereSql = $whereSql;
|
|
|
- $costData = Db::connect('db_advert')->query("SELECT SUM(money), site_id as cost FROM media_cost WHERE 1=1 $costWhereSql GROUP BY $groupBy");
|
|
|
+ $costData = Db::connect('db_advert')->query("SELECT SUM(money), site_id as cost FROM media_cost WHERE {$whereRaw} GROUP BY $groupBy");
|
|
|
$costData = array_column($costData, 'cost', 'site_id');
|
|
|
|
|
|
// 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))
|
|
|
@@ -583,26 +578,26 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
media_id,
|
|
|
agent_id,
|
|
|
auth_id";
|
|
|
- $baseWhereSql = $whereSql;
|
|
|
- $baseTotalDayData = $this->generateYearUnionList('base_total_day_', $params['reg_date'], $baseWhereSql, $baseTotalField, $groupBy);
|
|
|
+ $yearRange = getYearRange($params['reg_date'][0], $params['reg_date'][1]);
|
|
|
+ $baseTotalDayData = $this->generateUnionList('base_total_day', $yearRange, $whereRaw, $baseTotalField, $groupBy);
|
|
|
|
|
|
// active 活跃数,次留人数
|
|
|
- $activeWhereSql = $whereSql . ' AND days = 1';
|
|
|
- $activeWhereSql = str_replace('tdate', 'reg_date', $activeWhereSql);
|
|
|
+ $activeWhereRaw = $whereRaw . ' AND days = 1';
|
|
|
+ $activeWhereRaw = str_replace('tdate', 'reg_date', $activeWhereRaw);
|
|
|
$activeField = " sum(active_total) as active, site_id";
|
|
|
|
|
|
- $activeData = $this->generateYearUnionList('game_active_day_', $params['reg_date'], $activeWhereSql, $activeField, $groupBy);
|
|
|
+ $activeData = $this->generateUnionList('game_active_day', $yearRange, $activeWhereRaw, $activeField, $groupBy);
|
|
|
$activeData = array_column($activeData, 'active', 'site_id');
|
|
|
|
|
|
// 注册充值统计(累计充值reg_pay_total, 注册总充值(扣除分成)reg_pay_amount、注册累计付费人数(reg_pay_num))
|
|
|
- $regPayWhereSql = $whereSql;
|
|
|
+ $regPayWhereRaw = $whereRaw;
|
|
|
$regPayField = "
|
|
|
sum(addup_pay_num) as reg_pay_num,
|
|
|
sum(addup_pay_total) as reg_pay_total,
|
|
|
sum(addup_pay_amount) as reg_pay_amount,
|
|
|
site_id";
|
|
|
- $regPayWhereSql = str_replace('tdate', 'reg_date', $regPayWhereSql);
|
|
|
- $regPayData = $this->generateYearUnionList('game_reg_pay_day_', $params['reg_date'], $regPayWhereSql, $regPayField, $groupBy);
|
|
|
+ $regPayWhereRaw = str_replace('tdate', 'reg_date', $regPayWhereRaw);
|
|
|
+ $regPayData = $this->generateUnionList('game_reg_pay_day', $yearRange, $regPayWhereRaw, $regPayField, $groupBy);
|
|
|
|
|
|
$regPayData = array_column($regPayData, null, 'site_id');
|
|
|
|
|
|
@@ -682,23 +677,23 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
|
|
|
// 根据渠道名称获取渠道ID
|
|
|
if (!empty($params['site_name'])) {
|
|
|
- $agentData = Db::connect('db_advert')->query("SELECT id,name FROM agent_list WHERE 1=1 AND name = '{$params['agent_name']}'");
|
|
|
+ $agentData = Db::connect('db_advert')->query("SELECT id,name FROM agent_list WHERE name = '{$params['agent_name']}'");
|
|
|
$params['agent_id'] = $agentData[0]['id'] ?? 0;
|
|
|
}
|
|
|
|
|
|
// 根据广告名称获取广告ID
|
|
|
if (!empty($params['site_name'])) {
|
|
|
- $mediaData = Db::connect('db_advert')->query("SELECT id,name FROM agent_site WHERE 1=1 AND name = '{$params['site_name']}'");
|
|
|
+ $mediaData = Db::connect('db_advert')->query("SELECT id,name FROM agent_site WHERE name = '{$params['site_name']}'");
|
|
|
$params['media_id'] = $mediaData[0]['id'] ?? 0;
|
|
|
}
|
|
|
|
|
|
if (empty($params['agent_id'])) {
|
|
|
$params['agent_id'] = 0;
|
|
|
}
|
|
|
- $whereSql = $this->getCommonWhereRaw($params);
|
|
|
+ $whereRaw = $this->getCommonWhereRaw($params);
|
|
|
|
|
|
// 1. 消耗表. 获取消耗金额
|
|
|
- $costData = Db::connect('db_advert')->query("SELECT SUM(money) as cost FROM media_cost WHERE 1=1 $whereSql Group By tdate");
|
|
|
+ $costData = Db::connect('db_advert')->query("SELECT SUM(money) as cost FROM media_cost WHERE $whereRaw Group By tdate");
|
|
|
$costData = array_column($costData, 'cost', 'tdate');
|
|
|
|
|
|
// 2. 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))
|
|
|
@@ -713,28 +708,29 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
SUM(pay_amount) AS pay_amount,
|
|
|
SUM(pay_total) AS pay_total,
|
|
|
tdate";
|
|
|
- $baseWhereSql = $whereSql;
|
|
|
- $baseTotalDayData = $this->generateYearUnionList('base_total_day_', $params['reg_date'], $baseWhereSql, $baseTotalField, 'tdate');
|
|
|
+ $baseWhereRaw = $whereRaw;
|
|
|
+ $yearRange = getYearRange($params['reg_date'][0], $params['reg_date'][1]);
|
|
|
+ $baseTotalDayData = $this->generateUnionList('base_total_day', $yearRange, $baseWhereRaw, $baseTotalField, 'tdate');
|
|
|
$baseTotalDayData = array_column($baseTotalDayData, null, 'tdate');
|
|
|
|
|
|
// 3. active 活跃数,次留人数
|
|
|
- $activeWhereSql = $whereSql . ' AND days = 1';
|
|
|
- $activeWhereSql = str_replace('tdate', 'reg_date', $activeWhereSql);
|
|
|
+ $activeWhereRaw = $whereRaw . ' AND days = 1';
|
|
|
+ $activeWhereRaw = str_replace('tdate', 'reg_date', $activeWhereRaw);
|
|
|
$activeField = "
|
|
|
sum(active_total) as active,
|
|
|
reg_date astdate";
|
|
|
- $activeData = $this->generateYearUnionList('game_active_day_', $params['reg_date'], $activeWhereSql, $activeField, 'reg_date');
|
|
|
+ $activeData = $this->generateUnionList('game_active_day', $yearRange, $activeWhereRaw, $activeField, 'reg_date');
|
|
|
$activeData = array_column($activeData, 'active', 'tdate');
|
|
|
|
|
|
// 4. 注册充值统计(累计充值reg_pay_total, 注册总充值(扣除分成)reg_pay_amount、注册累计付费人数(reg_pay_num))
|
|
|
- $regPayWhereSql = $whereSql;
|
|
|
+ $regPayWhereRaw = $whereRaw;
|
|
|
$regPayField = "
|
|
|
sum(addup_pay_num) as reg_pay_num,
|
|
|
sum(addup_pay_total) as reg_pay_total,
|
|
|
sum(addup_pay_amount) as reg_pay_amount,
|
|
|
reg_date as tdate";
|
|
|
- $regPayWhereSql = str_replace('tdate', 'reg_date', $regPayWhereSql);
|
|
|
- $regPayData = $this->generateYearUnionList('game_reg_pay_day_', $params['reg_date'], $regPayWhereSql, $regPayField, 'reg_date');
|
|
|
+ $regPayWhereRaw = str_replace('tdate', 'reg_date', $regPayWhereRaw);
|
|
|
+ $regPayData = $this->generateUnionList('game_reg_pay_day', $yearRange, $regPayWhereRaw, $regPayField, 'reg_date');
|
|
|
|
|
|
$regPayData = array_column($regPayData, null, 'tdate');
|
|
|
|
|
|
@@ -808,14 +804,15 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
// 展示类型
|
|
|
$dataType = $params['data_type'] ?? 'recovery';
|
|
|
$nowDate = date("Y-m-d");
|
|
|
- $whereSql = $this->getCommonWhereRaw($params);
|
|
|
+ $whereRaw = $this->getCommonWhereRaw($params);
|
|
|
|
|
|
// 1. 获取消耗金额
|
|
|
- $costData = Db::connect('db_advert')->query("SELECT SUM(money) as cost, tdate FROM media_cost WHERE 1=1 $whereSql group by tdate");
|
|
|
+ $costData = Db::connect('db_advert')->query("SELECT SUM(money) as cost, tdate FROM media_cost WHERE $whereRaw group by tdate");
|
|
|
$costData = array_column($costData, 'cost', 'tdate');
|
|
|
|
|
|
// 2. 获取注册数
|
|
|
- $baseData = $this->generateYearUnionList('base_total_day_', $params['reg_date'], $whereSql, "SUM(reg_total) as reg_total, tdate", 'tdate');
|
|
|
+ $yearRange = getYearRange($params['reg_date'][0], $params['reg_date'][1]);
|
|
|
+ $baseData = $this->generateUnionList('base_total_day', $yearRange, $whereRaw, "SUM(reg_total) as reg_total, tdate", 'tdate');
|
|
|
$baseData = array_column($baseData, null, 'tdate');
|
|
|
|
|
|
// 3. 获取注册付费金额
|
|
|
@@ -828,8 +825,8 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
SUM(addup_pay_total) AS addup_pay_total,
|
|
|
SUM(addup_pay_amount) AS addup_pay_amount
|
|
|
";
|
|
|
- $regPayWhereSql = str_replace('tdate', 'reg_date', $whereSql);
|
|
|
- $regPayData = $this->generateYearUnionList('game_reg_pay_day_', $params['reg_date'], $regPayWhereSql, $field, 'reg_date,pay_date');
|
|
|
+ $regPayWhereRaw = str_replace('tdate', 'reg_date', $whereRaw);
|
|
|
+ $regPayData = $this->generateUnionList('game_reg_pay_day', $yearRange, $regPayWhereRaw, $field, 'reg_date,pay_date');
|
|
|
|
|
|
// 如果注册付费数据为空,则返回空数据给前端
|
|
|
if (empty($regPayData)) {
|
|
|
@@ -1048,11 +1045,11 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
// 展示类型
|
|
|
$dataType = $params['data_type'] ?? 'recovery';
|
|
|
$nowDate = date("Y-m");
|
|
|
- $whereSql = $this->getCommonWhereRaw($params);
|
|
|
+ $whereRaw = $this->getCommonWhereRaw($params);
|
|
|
|
|
|
// 2. 获取注册数
|
|
|
- $totalBaseWhereSql = str_replace('tdate', 'tmonth', $whereSql);
|
|
|
- $baseData = Db::connect('db_data_report')->query("SELECT tmonth,SUM(cost) as cost,SUM(reg_total) as reg_total FROM game_total_month WHERE 1=1 $totalBaseWhereSql GROUP BY tmonth");
|
|
|
+ $totalBaseWhereRaw = str_replace('tdate', 'tmonth', $whereRaw);
|
|
|
+ $baseData = Db::connect('db_data_report')->query("SELECT tmonth,SUM(cost) as cost,SUM(reg_total) as reg_total FROM game_total_month WHERE {$totalBaseWhereRaw} GROUP BY tmonth");
|
|
|
$baseData = array_column($baseData, null, 'tmonth');
|
|
|
|
|
|
// 3. 获取注册付费金额
|
|
|
@@ -1065,8 +1062,8 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
SUM(addup_pay_total) AS addup_pay_total,
|
|
|
SUM(addup_pay_amount) AS addup_pay_amount
|
|
|
";
|
|
|
- $regPayWhereSql = str_replace('tdate', 'reg_month', $whereSql);
|
|
|
- $regPayData = Db::connect('db_data_report')->query("SELECT $field FROM game_reg_pay_month WHERE 1=1 $regPayWhereSql GROUP BY reg_month,pay_month");
|
|
|
+ $regPayWhereRaw = str_replace('tdate', 'reg_month', $whereRaw);
|
|
|
+ $regPayData = Db::connect('db_data_report')->query("SELECT $field FROM game_reg_pay_month WHERE {$regPayWhereRaw} GROUP BY reg_month,pay_month");
|
|
|
|
|
|
// 如果注册付费数据为空,则返回空数据给前端
|
|
|
if (empty($regPayData)) {
|