推广后台->数据管理->数据汇总|每日概况--更新

master
chenxiaojun 5 years ago
parent 43603cf493
commit 7220247ecd

@ -1,7 +1,9 @@
<?php
namespace Base\Repository;
class SpendRepository {
class SpendRepository
{
public function __construct()
{
@ -37,6 +39,32 @@ class SpendRepository {
$conditions['pay_time'] = ['between', [$beginTime, $endTime]];
$conditions['game_id'] = ['in', $gameIds];
$conditions['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1'];
if (!empty($params['server_id'])) {
$conditions['server_id'] = $params['server_id'];
}
return $conditions;
}
private function getGameGroupConditionsNew($params)
{
$beginTime = $params['begin_time'] ?? 0;
$endTime = $params['end_time'] ?? 0;
$ids = $params['promote_ids'] ?? [];
$gameIds = $params['game_ids'] ?? [];
$conditions = [];
$conditions['pay_status'] = 1;
$conditions['promote_id'] = ['in', $ids];
$conditions['pay_time'] = ['between', [$beginTime, $endTime]];
$conditions['game_id'] = ['in', $gameIds];
if (!empty($params['server_id'])) {
$conditions['server_id'] = $params['server_id'];
}
if (isset($params['pay_way'])) {
$conditions['pay_way'] = $params['pay_way'];
}
return $conditions;
}
@ -98,40 +126,56 @@ class SpendRepository {
/**
* 按天统计付款总额
*/
public function getPayAmountGroupByDay($params) {
public function getPayAmountGroupByDay($params)
{
$dayList = $params['dayList'] ?? [];
$conditions = $this->getDayGroupConditions($params);
$field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day, sum(pay_amount) as amount';
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('day')->select();
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('day')->select();
return $this->assembleRecords($items, $dayList, 'amount');
}
/**
* 按天统计类型付款总额
*/
public function getPayAmountGroupByDayAndType($params) {
public function getPayAmountGroupByDayAndType($params)
{
$dayList = $params['dayList'] ?? [];
$conditions = $this->getDayGroupConditionsNew($params);
$field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day, sum(pay_amount) as amount';
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('day')->select();
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('day')->select();
return $this->assembleRecords($items, $dayList, 'amount');
}
/**
* 按游戏统计付款总额
*/
public function getPayAmountGroupByGame($params) {
public function getPayAmountGroupByGame($params)
{
$gameIds = $params['game_ids'] ?? [];
$conditions = $this->getGameGroupConditions($params);
$field = 'game_id, sum(pay_amount) as amount';
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
return $this->assembleRecords($items, $gameIds, 'amount', 'game_id');
}
/**
* 按游戏统计付款总额--cxj
*/
public function getPayAmountGroupByGameAndType($params)
{
$gameIds = $params['game_ids'] ?? [];
$conditions = $this->getGameGroupConditionsNew($params);
$field = 'game_id, sum(pay_amount) as amount';
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
return $this->assembleRecords($items, $gameIds, 'amount', 'game_id');
}
/**
* 按天统计付款用户数
*/
public function getPayUserCountGroupByDay($params) {
public function getPayUserCountGroupByDay($params)
{
$dayList = $params['dayList'] ?? [];
$conditions = $this->getDayGroupConditions($params);
$field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day, count(distinct user_id) count';
@ -139,10 +183,23 @@ class SpendRepository {
return $this->assembleRecords($items, $dayList, 'count');
}
/**
* 按天统计付款用户数--cxj
*/
public function getPayUserCountGroupByDayNew($params)
{
$dayList = $params['dayList'] ?? [];
$conditions = $this->getDayGroupConditions($params);
$field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day, count(distinct user_id, game_id) count';
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('day')->select();
return $this->assembleRecords($items, $dayList, 'count');
}
/**
* 按天统计付款次数
*/
public function getPayCountGroupByDay($params) {
public function getPayCountGroupByDay($params)
{
$dayList = $params['dayList'] ?? [];
$conditions = $this->getDayGroupConditions($params);
$field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day, count(*) count';
@ -150,10 +207,23 @@ class SpendRepository {
return $this->assembleRecords($items, $dayList, 'count');
}
/**
* 按游戏统计付款次数
*/
public function getPayCountGroupByGame($params)
{
$gameIds = $params['game_ids'] ?? [];
$conditions = $this->getGameGroupConditions($params);
$field = 'game_id, count(*) count';
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}
/**
* 游戏统计付款用户数
*/
public function getPayUserCountGroupByGame($params) {
public function getPayUserCountGroupByGame($params)
{
$gameIds = $params['game_ids'] ?? [];
$conditions = $this->getGameGroupConditions($params);
$field = 'game_id, count(distinct user_id) count';
@ -164,7 +234,8 @@ class SpendRepository {
/**
* 按照时间分组统计新增付费用户数
*/
public function getNewPayUserCountGroupByDay($params) {
public function getNewPayUserCountGroupByDay($params)
{
$dayList = $params['dayList'] ?? [];
$conditions = $this->getDayGroupConditions($params);
$oldConditions = $conditions;
@ -173,7 +244,7 @@ class SpendRepository {
foreach ($dayList as $day) {
$time = strtotime($day);
$oldConditions['pay_time'] = ['lt', $time];
$conditions['pay_time'] = ['between', [$time, ($time + 24 * 3600 -1)]];
$conditions['pay_time'] = ['between', [$time, ($time + 24 * 3600 - 1)]];
$oldQuery = M('spend', 'tab_')->field('user_id')->where($oldConditions)->group('user_id')->buildSql();
$conditions['user_id'] = ['exp', ' not in (' . $oldQuery . ')'];
$result = M('spend', 'tab_')->field('count(distinct user_id) count')->where($conditions)->find();
@ -185,7 +256,8 @@ class SpendRepository {
/**
* 按照时间分组统计新增付费用户数
*/
public function getNewPayUserCountGroupByGame($params) {
public function getNewPayUserCountGroupByGame($params)
{
$beginTime = $params['begin_time'] ?? 0;
$gameIds = $params['game_ids'] ?? [];
$conditions = $this->getGameGroupConditions($params);
@ -200,7 +272,8 @@ class SpendRepository {
/**
* 按照时间分组统计新增付费用户付费金额
*/
public function getNewPayAmountGroupByDay($params) {
public function getNewPayAmountGroupByDay($params)
{
$dayList = $params['dayList'] ?? [];
$conditions = $this->getDayGroupConditions($params);
$oldConditions = $conditions;
@ -209,7 +282,7 @@ class SpendRepository {
foreach ($dayList as $day) {
$time = strtotime($day);
$oldConditions['pay_time'] = ['lt', $time];
$conditions['pay_time'] = ['between', [$time, ($time + 24 * 3600 -1)]];
$conditions['pay_time'] = ['between', [$time, ($time + 24 * 3600 - 1)]];
$oldQuery = M('spend', 'tab_')->field('user_id')->where($oldConditions)->group('user_id')->buildSql();
$conditions['user_id'] = ['exp', ' not in (' . $oldQuery . ')'];
@ -222,7 +295,8 @@ class SpendRepository {
/**
* 按照游戏统计新增付费用户付费金额
*/
public function getNewPayAmountGroupByGame($params) {
public function getNewPayAmountGroupByGame($params)
{
$beginTime = $params['begin_time'] ?? 0;
$gameIds = $params['game_ids'] ?? [];
$conditions = $this->getGameGroupConditions($params);

@ -67,6 +67,10 @@ class UserRepository
$conditions['promote_id'] = ['in', $ids];
$conditions[$params['time_column']] = ['between', [$beginTime, $endTime]];
$conditions['game_id'] = ['in', $gameIds];
if (!empty($params['server_id'])) {
$conditions['server_id'] = $params['server_id'];
}
return $conditions;
}
@ -91,6 +95,25 @@ class UserRepository
return $conditions;
}
private function getCreateRoleByGameConditions($params)
{
$beginTime = $params['begin_time'] ?? 0;
$endTime = $params['end_time'] ?? 0;
$ids = $params['promote_ids'] ?? [];
$gameIds = $params['game_ids'] ?? [];
$serverId = $params['server_id'] ?? 0;
$conditions = [];
$conditions['promote_id'] = ['in', $ids];
$conditions[$params['time_column']] = ['between', [$beginTime, $endTime]];
$conditions['game_id'] = ['in', $gameIds];
if ($serverId > 0) {
$conditions['server_id'] = $serverId;
}
return $conditions;
}
/**
* 按照时间分组统计登录总数
*/
@ -107,6 +130,22 @@ class UserRepository
return $this->assembleRecords($items, $dayList, 'count');
}
/**
* 按照时间分组统计登录总数
*/
public function getLoginCountGroupByDayNew($params)
{
$dayList = $params['dayList'] ?? [];
$params['time_column'] = 'login_time';
$conditions = $this->getDayGroupConditions($params);
$items = M('user_login_record', 'tab_')->field('FROM_UNIXTIME(login_time, "%Y-%m-%d") as day, count(DISTINCT user_id, game_id) as count')
->where($conditions)
->group('day')
->select();
return $this->assembleRecords($items, $dayList, 'count');
}
/**
* 按照游戏分组统计登录总数
*/
@ -220,6 +259,22 @@ class UserRepository
return $this->assembleRecords($items, $dayList, 'count');
}
/**
* 按照游戏统计创角数
*/
public function getCreateRoleCountByGame($params)
{
$gameIds = $params['game_ids'] ?? [];
$params['time_column'] = 'create_time';
$conditions = $this->getCreateRoleByGameConditions($params);
$items = M('user_play_info', 'tab_')->field('count(*) count, game_id')
->where($conditions)
->group('game_id')
->select();
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}
/**
* 按照时间统计创角用户(去重)
*/
@ -236,6 +291,22 @@ class UserRepository
return $this->assembleRecords($items, $dayList, 'count');
}
/**
* 按照游戏统计创角用户(去重)
*/
public function getCreateRoleUserCountByGame($params)
{
$gameIds = $params['game_ids'] ?? [];
$params['time_column'] = 'create_time';
$conditions = $this->getCreateRoleByGameConditions($params);
$items = M('user_play_info', 'tab_')->field('count(distinct game_id,user_id) count, game_id')
->where($conditions)
->group('game_id')
->select();
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}
/**
* 按照时间统计新创角用户(去重)
*/
@ -265,6 +336,34 @@ class UserRepository
return $this->assembleRecords($items, $dayList, 'count');
}
/**
* 按照游戏统计新创角用户(去重)
*/
public function getNewCreateRoleUserCountByGame($params)
{
$gameIds = $params['game_ids'] ?? [];
$params['time_column'] = 'create_time';
$conditions = $this->getCreateRoleByGameConditions($params);
$conditionsSql = $conditions;
unset($conditionsSql['begin_time']);
unset($conditionsSql['end_time']);
$alias = 'ti';
$conditionsSql = $this->setKeys($conditionsSql, $alias);
$model = M('user_play_info', 'tab_');
$sql = $model->alias($alias)
->where($conditionsSql)
->where("ti.user_id = user_id and ti.game_id = game_id and ti.create_time < " . $params['begin_time'])
->fetchSql(true)
->count();
$items = $model->field("count(distinct game_id,user_id) count, game_id, (" . $sql . ") as num")
->where($conditions)
->group("game_id")
->having('num = 0')
->select();
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}
/**
* 按照时间统计新创角设备(去重)
*/
@ -294,6 +393,34 @@ class UserRepository
return $this->assembleRecords($items, $dayList, 'count');
}
/**
* 按照游戏统计新创角设备(去重)
*/
public function getNewCreateRoleDeviceCountByGame($params)
{
$gameIds = $params['game_ids'] ?? [];
$params['time_column'] = 'create_time';
$conditions = $this->getCreateRoleByGameConditions($params);
$conditionsSql = $conditions;
unset($conditionsSql['begin_time']);
unset($conditionsSql['end_time']);
$alias = 'ti';
$conditionsSql = $this->setKeys($conditionsSql, $alias);
$model = M('user_play_info', 'tab_');
$sql = $model->alias($alias)
->where($conditionsSql)
->where("ti.create_device_number = create_device_number and ti.game_id = game_id and ti.create_time < " . $params['begin_time'])
->fetchSql(true)
->count();
$items = $model->field("count(distinct game_id,create_device_number) count, game_id, (" . $sql . ") as num")
->where($conditions)
->group("game_id")
->having('num = 0')
->select();
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}
/**
* 按照时间统计新创角IP(去重)
*/
@ -322,4 +449,32 @@ class UserRepository
->select();
return $this->assembleRecords($items, $dayList, 'count');
}
/**
* 按照游戏统计新创角IP(去重)
*/
public function getNewCreateRoleIpCountByGame($params)
{
$gameIds = $params['game_ids'] ?? [];
$params['time_column'] = 'create_time';
$conditions = $this->getCreateRoleByGameConditions($params);
$conditionsSql = $conditions;
unset($conditionsSql['begin_time']);
unset($conditionsSql['end_time']);
$alias = 'ti';
$conditionsSql = $this->setKeys($conditionsSql, $alias);
$model = M('user_play_info', 'tab_');
$sql = $model->alias($alias)
->where($conditionsSql)
->where("ti.create_ip = create_ip and ti.game_id = game_id and ti.create_time < " . $params['begin_time'])
->fetchSql(true)
->count();
$items = $model->field("count(distinct game_id,create_ip) count, game_id, (" . $sql . ") as num")
->where($conditions)
->group("game_id")
->having('num = 0')
->select();
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}
}

@ -1067,6 +1067,7 @@ class QueryController extends BaseController
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$endTime += + 3600 * 24;
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
@ -1083,12 +1084,12 @@ class QueryController extends BaseController
$params['promote_id'] = $ids;
}
if ($relationGameId > 0 || $serverId > 0) {
if ($relationGameId > 0 || $sdkVersion > 0) {
if ($sdkVersion > 0) {
$map['sdk_version'] = $sdkVersion;
}
if ($relationGameId > 0) {
$map = ['relation_game_id' => $relationGameId];
$map['relation_game_id'] = $relationGameId;
}
$gameIds = M('Game', 'tab_')->where($map)->getField('id', true);
if (empty($gameIds)) {
@ -1102,7 +1103,7 @@ class QueryController extends BaseController
$params['end_time'] = $endTime;
$summaryData = [];
$dayList = $this->getDayList($begTime, $endTime + 3600 * 24);
$dayList = $this->getDayList($begTime, $endTime);
$params['dayList'] = $dayList;
$records = [];
@ -1114,8 +1115,8 @@ class QueryController extends BaseController
$newUserNumList = $userRepository->getNewCreateRoleUserCountByDay($params);//新创角用户
$newDeviceNumList = $userRepository->getNewCreateRoleDeviceCountByDay($params);//新创角设备
$newIpNumList = $userRepository->getNewCreateRoleIpCountByDay($params);//新创角IP
$loginUserNumList = $userRepository->getLoginCountGroupByDay($params);//登录用户数
$spendUserNumList = $spendRepository->getPayUserCountGroupByDay($params);//充值人数
$loginUserNumList = $userRepository->getLoginCountGroupByDayNew($params);//登录用户数
$spendUserNumList = $spendRepository->getPayUserCountGroupByDayNew($params);//充值人数
$spendNumList = $spendRepository->getPayCountGroupByDay($params);//充值次数
$spendAllAmountList = $spendRepository->getPayAmountGroupByDayAndType($params);//充值总额
$params['pay_way'] = ['in', '1,2,3,4,5,6'];
@ -1222,6 +1223,7 @@ class QueryController extends BaseController
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$endTime += 3600 * 24;
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
@ -1242,9 +1244,7 @@ class QueryController extends BaseController
$ownId = intval(I('own_id'), 0);//本账号
if ($ownId) {
$map['a.promote_id'] = $queryPromote['id'];
$userPlayInfoMap['tab_user_play_info.promote_id'] = $queryPromote['id'];
$userGameLoginMap['tab_user_game_login_record.promote_id'] = $queryPromote['id'];
$spendMap['tab_spend.promote_id'] = $queryPromote['id'];
$params['promote_ids'] = $queryPromote['id'];
} else {
$map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
@ -1252,9 +1252,7 @@ class QueryController extends BaseController
$map = [];
$map['a.promote_id'] = ['in', $ids];
$userPlayInfoMap['tab_user_play_info.promote_id'] = ['in', $ids];
$userGameLoginMap['tab_user_game_login_record.promote_id'] = ['in', $ids];
$spendMap['tab_spend.promote_id'] = ['in', $ids];
$params['promote_ids'] = $ids;
}
if ($relationGameId > 0) {
$map['g.relation_game_id'] = $relationGameId;
@ -1266,19 +1264,11 @@ class QueryController extends BaseController
if ($serverId > 0) {
$serverJoin = 'tab_server as s on s.game_id = a.game_id';
$map['s.server_id'] = $serverId;
$userPlayInfoMap['tab_user_play_info.server_id'] = $serverId;
$userGameLoginMap['tab_user_game_login_record.server_id'] = $serverId;
$spendMap['tab_spend.server_id'] = $serverId;
$params['server_id'] = $serverId;
}
$userPlayInfoMap2 = $userPlayInfoMap;
$userPlayInfoMap['tab_user_play_info.create_time'] = ['between', [$begTime, $endTime + 86399]];
$userGameLoginMap['tab_user_game_login_record.login_time'] = ['between', [$begTime, $endTime + 86399]];
$spendMap['tab_spend.pay_time'] = ['between', [$begTime, $endTime + 86399]];
$spendMap['tab_spend.pay_status'] = 1;
$userPlayInfoModel = M('UserPlayInfo', 'tab_');
$userGameLoginModel = M('UserGameLoginRecord', 'tab_');
$spendModel = M('Spend', 'tab_');
$params['begin_time'] = $begTime;
$params['end_time'] = $endTime;
$data = M('Apply', 'tab_')->alias('a')
->field('a.game_id,a.game_name,a.sdk_version')
@ -1295,6 +1285,7 @@ class QueryController extends BaseController
->where($map)
->count('distinct a.game_id');
$records = [];
$allData['role_num'] = 0;
$allData['user_num'] = 0;
$allData['new_user_num'] = 0;
@ -1310,68 +1301,65 @@ class QueryController extends BaseController
$allData['spend_discount'] = 0;
$allData['spend_voucher'] = 0;
if (!empty($data)) {
$gameIds = [];
foreach ($data as $list) {
$gameIds[] = $list['game_id'];
}
$params['game_ids'] = $gameIds;
$userRepository = new UserRepository();
$spendRepository = new SpendRepository();
$roleNumList = $userRepository->getCreateRoleCountByGame($params);//创角数
$userNumList = $userRepository->getCreateRoleUserCountByGame($params);//创角用户
$newUserNumList = $userRepository->getNewCreateRoleUserCountByGame($params);//新创角用户
$newDeviceNumList = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备
$newIpNumList = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP
$loginUserNumList = $userRepository->getLoginCountGroupByGame($params);//登录用户数
$spendUserNumList = $spendRepository->getPayUserCountGroupByGame($params);//充值人数
$spendNumList = $spendRepository->getPayCountGroupByGame($params);//充值次数
$spendAllAmountList = $spendRepository->getPayAmountGroupByGameAndType($params);//充值总额
$params['pay_way'] = ['in', '1,2,3,4,5,6'];
$spendCashList = $spendRepository->getPayAmountGroupByGameAndType($params);//现金充值
$params['pay_way'] = 0;
$spendGenericList = $spendRepository->getPayAmountGroupByGameAndType($params);//通用币充值
$params['pay_way'] = -1;
$spendBindingList = $spendRepository->getPayAmountGroupByGameAndType($params);//绑定币充值
foreach ($data as &$list) {
$userPlayInfoMap['tab_user_play_info.game_id'] = $list['game_id'];
$userPlayInfoMap2['tab_user_play_info.game_id'] = $list['game_id'];
$userGameLoginMap['tab_user_game_login_record.game_id'] = $list['game_id'];
$spendMap['tab_spend.game_id'] = $list['game_id'];
$thisData = $userPlayInfoModel
->field('count(*) as role_num,count(distinct tab_user_play_info.user_id) as user_num')
->where($userPlayInfoMap)
->find();
$list['role_num'] = $thisData['role_num'];//创角数
$list['user_num'] = $thisData['user_num'];//创角用户
$thisData = $userPlayInfoModel
->field('tab_user_play_info.create_time,count(distinct tab_user_play_info.user_id) as new_user_num,
count(distinct tab_user_play_info.create_device_number) as new_device_num,
count(distinct tab_user_play_info.create_ip) as new_ip_num')
->where($userPlayInfoMap2)
->having('tab_user_play_info.create_time between ' . $begTime . ' and ' . ($endTime + 86399))
->order('tab_user_play_info.id')
->find();
$list['new_user_num'] = empty($thisData['new_user_num']) ? 0 : $thisData['new_user_num'];//新创角用户
$list['new_device_num'] = empty($thisData['new_device_num']) ? 0 : $thisData['new_device_num'];//新创角设备
$list['new_ip_num'] = empty($thisData['new_ip_num']) ? 0 : $thisData['new_ip_num'];//新增创角IP
$list['login_user_num'] = count($userGameLoginModel
->where($userGameLoginMap)
->group('tab_user_game_login_record.game_id,tab_user_game_login_record.user_id')
->select());//登录用户数
$thisData = $spendModel
->field('count(distinct tab_spend.user_id) as spend_user_num,count(*) as spend_num,
sum(tab_spend.pay_amount) as spend_all_amount,
sum(if(tab_spend.pay_way > 0,tab_spend.pay_amount,0)) as spend_cash,
sum(if(tab_spend.pay_way = 0,tab_spend.pay_amount,0)) as spend_generic,
sum(if(tab_spend.pay_way = -1,tab_spend.pay_amount,0)) as spend_binding')
->where($spendMap)
->find();
$list['spend_user_num'] = $thisData['spend_user_num'];//充值人数
$list['spend_num'] = $thisData['spend_num'];//充值次数
$list['spend_all_amount'] = $thisData['spend_all_amount'];//充值总额
$list['spend_cash'] = $thisData['spend_cash'];//现金充值
$list['spend_generic'] = $thisData['spend_generic'];//通用币
$list['spend_binding'] = $thisData['spend_binding'];//绑定币
$list['spend_discount'] = 0;//折扣币
$list['spend_voucher'] = 0;//代金券
$allData['role_num'] += $list['role_num'];
$allData['user_num'] += $list['user_num'];
$allData['new_user_num'] += $list['new_user_num'];
$allData['new_device_num'] += $list['new_device_num'];
$allData['new_ip_num'] += $list['new_ip_num'];
$allData['login_user_num'] += $list['login_user_num'];
$allData['spend_user_num'] += $list['spend_user_num'];
$allData['spend_num'] += $list['spend_num'];
$allData['spend_all_amount'] = bcadd($allData['spend_all_amount'], $list['spend_all_amount'], 2);
$allData['spend_cash'] = bcadd($allData['spend_cash'], $list['spend_cash'], 2);
$allData['spend_generic'] = bcadd($allData['spend_generic'], $list['spend_generic'], 2);
$allData['spend_binding'] = bcadd($allData['spend_binding'], $list['spend_binding'], 2);
$allData['spend_discount'] = bcadd($allData['spend_discount'], $list['spend_discount'], 2);
$allData['spend_voucher'] = bcadd($allData['spend_voucher'], $list['spend_voucher'], 2);
$gameId = $list['game_id'];
$records[] = [
'game_id' => $gameId,
'game_name' => $list['game_name'],
'sdk_version' => $list['sdk_version'],
'role_num' => $roleNumList[$gameId],
'user_num' => $userNumList[$gameId],
'new_user_num' => $newUserNumList[$gameId],
'new_device_num' => $newDeviceNumList[$gameId],
'new_ip_num' => $newIpNumList[$gameId],
'login_user_num' => $loginUserNumList[$gameId],
'spend_user_num' => $spendUserNumList[$gameId],
'spend_num' => $spendNumList[$gameId],
'spend_all_amount' => $spendAllAmountList[$gameId],
'spend_cash' => $spendCashList[$gameId],
'spend_generic' => $spendGenericList[$gameId],
'spend_binding' => $spendBindingList[$gameId],
'spend_discount' => 0,
'spend_voucher' => 0,
];
$allData['role_num'] += $roleNumList[$gameId];
$allData['user_num'] += $userNumList[$gameId];
$allData['new_user_num'] += $newUserNumList[$gameId];
$allData['new_device_num'] += $newDeviceNumList[$gameId];
$allData['new_ip_num'] += $newIpNumList[$gameId];
$allData['login_user_num'] += $loginUserNumList[$gameId];
$allData['spend_user_num'] += $spendUserNumList[$gameId];
$allData['spend_num'] += $spendNumList[$gameId];
$allData['spend_all_amount'] = bcadd($allData['spend_all_amount'], $spendAllAmountList[$gameId], 2);
$allData['spend_cash'] = bcadd($allData['spend_cash'], $spendCashList[$gameId], 2);
$allData['spend_generic'] = bcadd($allData['spend_generic'], $spendGenericList[$gameId], 2);
$allData['spend_binding'] = bcadd($allData['spend_binding'], $spendBindingList[$gameId], 2);
$allData['spend_discount'] = bcadd($allData['spend_discount'], 0, 2);
$allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2);
}
}
@ -1385,7 +1373,7 @@ class QueryController extends BaseController
$this->assign('loginPromote', $loginPromote);
$this->assign('ownId', $ownId);
$this->assign('allData', $allData);
$this->assign('listData', $data);
$this->assign('listData', $records);
$this->assign('count', $count);
$this->assign('setdate', date("Y-m-d"));
$this->assign('initBegTime', $initBegTime);

@ -534,7 +534,7 @@
return false;
}
if ((edate - sdate) > 2592000) {
if ((edate - sdate) > 2505600) {
layer.msg('时间间隔不能超过30天请重新选择日期');
return false;
}

@ -302,12 +302,18 @@
});
$('#submit').click(function () {
var sdate = $('#sdate').val();
var edate = $('#edate').val();
if (Date.parse(sdate) > Date.parse(edate)) {
var sdate = Date.parse($('#sdate').val()) / 1000;
var edate = Date.parse($('#edate').val()) / 1000;
if (sdate > edate) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
if ((edate - sdate) > 2505600) {
layer.msg('时间间隔不能超过30天请重新选择日期');
return false;
}
var url = $(this).attr('url');
console.log(url);
var query = $('.jssearch').find('input').serialize();

Loading…
Cancel
Save