@ -151,6 +151,7 @@ class StatController extends ThinkController
$baseGameId = I('game_id', 0);
$deviceType = I('device_type', '');
$promoteId = I('promote_id', 0);
$companyId = I('company_id', 0);
$orderType = 'asc';
$orderColumn = 'date';
@ -196,6 +197,7 @@ class StatController extends ThinkController
'start_time' => $start,
'end_time' => $end,
'promote_id' => I('promote_id', 0),
'company_id' => I('company_id', 0),
'game_ids' => $gameIds,
]
]);
@ -213,6 +215,11 @@ class StatController extends ThinkController
if ($promoteId) {
$promote = M('promote', 'tab_')->where(['id' => $promoteId])->find();
$promoteName = $promote['account'];
$promote['model_type'] = 'promote';
} elseif ($companyId) {
$promote = M('promote_company', 'tab_')->where(['id' => $companyId])->find();
$promoteName = $promote['company_name'];
$promote['model_type'] = 'company';
}
foreach ($data as $key => $item) {
$item['promote_name'] = $promoteName;
@ -246,7 +253,15 @@ class StatController extends ThinkController
}
$baseGames = M('base_game', 'tab_')->select();
$companies = M('promote_company', 'tab_')->field(['id', 'company_name'])->select();
$promoteMap = ['_string' => '1=1'];
if ($companyId) {
$promoteMap['company_id'] = $companyId;
}
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where($promoteMap)->select();
$this->assign('promoteName', $promoteName);
$this->assign('promotes', $promotes);
$this->assign('companies', $companies);
$this->assign('baseGames', $baseGames);
$this->checkListOrCountAuthRestMap($map,[]);
@ -712,6 +727,7 @@ AND UNIX_TIMESTAMP(
$end = I('end', date('Y-m-d'));
$baseGameIds = I('game_ids', '');
$promoteId = I('promote_id', 0);
$companyId = I('company_id', 0);
$dataOrder = I('data_order', '');
$deviceType = I('device_type', '');
$containBindCoins = I('contain_bind_coins', 0);
@ -729,6 +745,8 @@ AND UNIX_TIMESTAMP(
$promote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $promoteId])->find();
$promoteIds = M('promote', 'tab_')->where(['chain' => ['like', $promote['chain'] . $promote['id'] . '/%']])->getField('id', true);
$promoteIds[] = $promote['id'];
} elseif ($companyId > 0) {
$promoteIds = M('promote', 'tab_')->where(['company_id' => $companyId])->getField('id', true);
}
$startTime = strtotime($start . ' 00:00:00');
@ -859,6 +877,16 @@ AND UNIX_TIMESTAMP(
$this->checkListOrCountAuthRestMap($map,[]);
$this->meta_title = 'ARPU统计';
$companies = M('promote_company', 'tab_')->field(['id', 'company_name'])->select();
$promoteMap = ['_string' => '1=1'];
if ($companyId) {
$promoteMap['company_id'] = $companyId;
}
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where($promoteMap)->select();
$this->assign('promotes', $promotes);
$this->assign('companies', $companies);
$this->assign('showPromote', session('user_auth')['show_promote']);
$this->assign('baseGames', $baseGames);
$this->assign('records', $rows);
@ -2057,6 +2085,14 @@ AND UNIX_TIMESTAMP(
}
public function getPromotes()
{
$companyId = I('company_id', 0);
$companyMap = ['_string' => '1=1'];
if ($companyId > 0) {
$companyMap['company_id'] = $companyId;
}
$promotes = M('promote', 'tab_')->where($companyMap)->field(['id', 'account'])->select();
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['promotes' => $promotes]]);
}
}