|
|
@@ -14,15 +14,14 @@ class AnalyseLogic extends BaseLogic
|
|
|
{
|
|
|
$params = $this->searchByAuth($params);
|
|
|
$whereRaw = $this->getCommonWhereRaw($params);
|
|
|
- $field = "SUM(reg_total) AS reg_total, tdate,game_id";
|
|
|
+ $field = "SUM(reg_total) AS reg_total, tdate, game_id";
|
|
|
$yearRange = getYearRange($params['reg_date'][0], $params['reg_date'][1]);
|
|
|
$baseData = $this->generateUnionList('base_total_day', $yearRange, $whereRaw, $field, 'game_id,tdate');
|
|
|
|
|
|
$data = [];
|
|
|
foreach ($baseData as $row) {
|
|
|
- $tdate = $row['tdate'];
|
|
|
$game_id = $row['game_id'];
|
|
|
- $data[$game_id][$tdate] = $row['reg_total'];
|
|
|
+ $data[$game_id][$row['tdate']] = $row['reg_total'];
|
|
|
$data[$game_id]['total'] = !empty($data[$game_id]['total']) ? $data[$game_id]['total'] + $row['reg_total'] : $row['reg_total'];
|
|
|
$data[$game_id]['game_id'] = $game_id;
|
|
|
}
|
|
|
@@ -205,7 +204,7 @@ class AnalyseLogic extends BaseLogic
|
|
|
$totalRow[$totalKey] = getPercent($row['active_total'], $row['reg_total']);
|
|
|
|
|
|
}
|
|
|
- $totalRow['total'] = getPercent($totalRow['total_active_total']??0, $totalRow['total_reg_total']??0);
|
|
|
+ $totalRow['total'] = getPercent($totalRow['total_active_total'] ?? 0, $totalRow['total_reg_total'] ?? 0);
|
|
|
|
|
|
// 获取两个注册日期之间的日期列表
|
|
|
$dateList = getDateRange($where['reg_date'][0], $where['reg_date'][1]);
|
|
|
@@ -500,7 +499,7 @@ class AnalyseLogic extends BaseLogic
|
|
|
];
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 付费留存
|
|
|
* 1. 登录日志表:sdk_login_log_, 查找符合注册时间的用户, 获取用户id
|
|
|
@@ -513,7 +512,7 @@ class AnalyseLogic extends BaseLogic
|
|
|
public function getPayRetention($where)
|
|
|
{
|
|
|
$params = $this->searchByAuth($where);
|
|
|
-
|
|
|
+
|
|
|
// 判断不能超过90天查询
|
|
|
$days = getDateNum($where['reg_date'][0], $where['reg_date'][1]);
|
|
|
if ($days > 90) {
|
|
|
@@ -596,7 +595,7 @@ class AnalyseLogic extends BaseLogic
|
|
|
if ($data) foreach ($data as $item) {
|
|
|
|
|
|
$totalRow['reg_pay_num'] = $totalRow['reg_pay_num'] ?? 0;
|
|
|
- $totalRow['reg_pay_num'] = $totalRow['reg_pay_num']? $totalRow['reg_pay_num']+$item['reg_pay_num'] : $item['reg_pay_num'];
|
|
|
+ $totalRow['reg_pay_num'] = $totalRow['reg_pay_num'] ? $totalRow['reg_pay_num'] + $item['reg_pay_num'] : $item['reg_pay_num'];
|
|
|
|
|
|
foreach ($remainRange as $remainNum) {
|
|
|
$key = 'remain_' . $remainNum;
|