|
|
@@ -142,7 +142,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
|
|
|
$actDataSql = "select reg_date as tdate, days, sum(active_total) as active from ({$unionGameActiveDaySql}) as all_game_active_day group by reg_date,days";
|
|
|
// 替换日期字段, 因为game_active_day_表的日期字段是[reg_date]
|
|
|
- $actDataSql = str_replace("AND tdate", "AND reg_date", $actDataSql);
|
|
|
+ $actDataSql = str_replace("tdate", "reg_date", $actDataSql);
|
|
|
// 日期、活跃天数、活跃数,按日期和活跃天数分组
|
|
|
$actData = Db::connect('db_data_report')->query($actDataSql);
|
|
|
|
|
|
@@ -281,7 +281,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
|
|
|
// 3. 获取活跃数
|
|
|
$activeWhereSql = $whereSql . ' AND days = 1';
|
|
|
- $activeWhereSql = str_replace('AND tdate', 'AND reg_date', $activeWhereSql);
|
|
|
+ $activeWhereSql = str_replace('tdate', 'reg_date', $activeWhereSql);
|
|
|
$activeField = "
|
|
|
sum(active_total) as active,
|
|
|
game_id,
|
|
|
@@ -297,7 +297,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
sum(addup_pay_total) as reg_pay_total,
|
|
|
sum(addup_pay_amount) as reg_pay_amount,
|
|
|
{$type}";
|
|
|
- $regPayWhereSql = str_replace('AND tdate', 'AND reg_date', $regPayWhereSql);
|
|
|
+ $regPayWhereSql = str_replace('tdate', 'reg_date', $regPayWhereSql);
|
|
|
|
|
|
$regPayData = $this->generateYearUnionList('game_reg_pay_day_', $params['reg_date'], $regPayWhereSql, $regPayField, $type);
|
|
|
$regPayData = array_column($regPayData, null, $type);
|
|
|
@@ -515,7 +515,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
|
|
|
// 3. 注册付费表. 获取总付费人数(reg_pay_num)
|
|
|
$regPayField = "sum(addup_pay_num) as reg_pay_num";
|
|
|
- $regPayWhereSql = str_replace('AND tdate', 'AND reg_date', $whereSql);
|
|
|
+ $regPayWhereSql = str_replace('tdate', 'reg_date', $whereSql);
|
|
|
$regPayData = $this->generateYearUnionList('game_reg_pay_day_', $where['reg_date'], $regPayWhereSql, $regPayField);
|
|
|
$regPayNum = $regPayData[0]['reg_pay_num'] ?? 0;
|
|
|
|
|
|
@@ -588,7 +588,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
|
|
|
// active 活跃数,次留人数
|
|
|
$activeWhereSql = $whereSql . ' AND days = 1';
|
|
|
- $activeWhereSql = str_replace('AND tdate', 'AND reg_date', $activeWhereSql);
|
|
|
+ $activeWhereSql = str_replace('tdate', 'reg_date', $activeWhereSql);
|
|
|
$activeField = " sum(active_total) as active, site_id";
|
|
|
|
|
|
$activeData = $this->generateYearUnionList('game_active_day_', $params['reg_date'], $activeWhereSql, $activeField, $groupBy);
|
|
|
@@ -601,7 +601,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
sum(addup_pay_total) as reg_pay_total,
|
|
|
sum(addup_pay_amount) as reg_pay_amount,
|
|
|
site_id";
|
|
|
- $regPayWhereSql = str_replace('AND tdate', 'AND reg_date', $regPayWhereSql);
|
|
|
+ $regPayWhereSql = str_replace('tdate', 'reg_date', $regPayWhereSql);
|
|
|
$regPayData = $this->generateYearUnionList('game_reg_pay_day_', $params['reg_date'], $regPayWhereSql, $regPayField, $groupBy);
|
|
|
|
|
|
$regPayData = array_column($regPayData, null, 'site_id');
|
|
|
@@ -719,7 +719,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
|
|
|
// 3. active 活跃数,次留人数
|
|
|
$activeWhereSql = $whereSql . ' AND days = 1';
|
|
|
- $activeWhereSql = str_replace('AND tdate', 'AND reg_date', $activeWhereSql);
|
|
|
+ $activeWhereSql = str_replace('tdate', 'reg_date', $activeWhereSql);
|
|
|
$activeField = "
|
|
|
sum(active_total) as active,
|
|
|
reg_date astdate";
|
|
|
@@ -733,7 +733,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
sum(addup_pay_total) as reg_pay_total,
|
|
|
sum(addup_pay_amount) as reg_pay_amount,
|
|
|
reg_date as tdate";
|
|
|
- $regPayWhereSql = str_replace('AND tdate', 'AND reg_date', $regPayWhereSql);
|
|
|
+ $regPayWhereSql = str_replace('tdate', 'reg_date', $regPayWhereSql);
|
|
|
$regPayData = $this->generateYearUnionList('game_reg_pay_day_', $params['reg_date'], $regPayWhereSql, $regPayField, 'reg_date');
|
|
|
|
|
|
$regPayData = array_column($regPayData, null, 'tdate');
|
|
|
@@ -828,7 +828,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
SUM(addup_pay_total) AS addup_pay_total,
|
|
|
SUM(addup_pay_amount) AS addup_pay_amount
|
|
|
";
|
|
|
- $regPayWhereSql = str_replace('AND tdate', 'AND reg_date', $whereSql);
|
|
|
+ $regPayWhereSql = str_replace('tdate', 'reg_date', $whereSql);
|
|
|
$regPayData = $this->generateYearUnionList('game_reg_pay_day_', $params['reg_date'], $regPayWhereSql, $field, 'reg_date,pay_date');
|
|
|
|
|
|
// 如果注册付费数据为空,则返回空数据给前端
|
|
|
@@ -1051,7 +1051,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
$whereSql = $this->getCommonWhereRaw($params);
|
|
|
|
|
|
// 2. 获取注册数
|
|
|
- $totalBaseWhereSql = str_replace('AND tdate', 'AND tmonth', $whereSql);
|
|
|
+ $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");
|
|
|
$baseData = array_column($baseData, null, 'tmonth');
|
|
|
|
|
|
@@ -1065,7 +1065,7 @@ class ChannelAnalysisLogic extends BaseLogic
|
|
|
SUM(addup_pay_total) AS addup_pay_total,
|
|
|
SUM(addup_pay_amount) AS addup_pay_amount
|
|
|
";
|
|
|
- $regPayWhereSql = str_replace('AND tdate', 'AND reg_month', $whereSql);
|
|
|
+ $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");
|
|
|
|
|
|
// 如果注册付费数据为空,则返回空数据给前端
|