|
|
|
@ -47,38 +47,38 @@ class QueryController extends BaseController
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$map1['chain'] = ['like','%'.PID.'/'.'%'];
|
|
|
|
|
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
|
|
|
|
|
$map1['chain'] = ['like', '%' . PID . '/' . '%'];
|
|
|
|
|
$rs = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select();
|
|
|
|
|
$childPromoteIds = '';
|
|
|
|
|
if(empty($rs)) {
|
|
|
|
|
if (empty($rs)) {
|
|
|
|
|
$map['tab_spend.promote_id'] = PID;
|
|
|
|
|
}else {
|
|
|
|
|
foreach ($rs as $rsKey => $rsValue) {
|
|
|
|
|
} else {
|
|
|
|
|
foreach ($rs as $rsKey => $rsValue) {
|
|
|
|
|
$id = $rsValue['id'];
|
|
|
|
|
$childPromoteIds .= $id.',';
|
|
|
|
|
$childPromoteIds .= $id . ',';
|
|
|
|
|
}
|
|
|
|
|
$childPromoteIds = rtrim($childPromoteIds, ',');
|
|
|
|
|
$childPromoteIds .= ',' . PID;
|
|
|
|
|
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
|
|
|
|
|
$childPromoteIds = rtrim($childPromoteIds, ',');
|
|
|
|
|
$childPromoteIds .= ',' . PID;
|
|
|
|
|
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$levelPromote = I('level_promote', []);
|
|
|
|
|
$promote = $this->getLoginPromote();
|
|
|
|
|
$queryPromote = $this->getQueryPromote($levelPromote);
|
|
|
|
|
$map2['chain'] = ['like', $queryPromote['chain'].$queryPromote['id'].'/%'];
|
|
|
|
|
$map2['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
|
|
|
|
|
$ids = M('promote', 'tab_')->where($map2)->getField('id', true);
|
|
|
|
|
if(empty($ids)) {
|
|
|
|
|
$ids = array();
|
|
|
|
|
if (empty($ids)) {
|
|
|
|
|
$ids = array();
|
|
|
|
|
}
|
|
|
|
|
if(empty($levelPromote)) {
|
|
|
|
|
array_push($ids,PID);
|
|
|
|
|
if (empty($levelPromote)) {
|
|
|
|
|
array_push($ids, PID);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
array_push($ids,$queryPromote['id']);
|
|
|
|
|
array_push($ids, $queryPromote['id']);
|
|
|
|
|
if (!empty($ids)) {
|
|
|
|
|
$map['tab_spend.promote_id'] = ['in',$ids];
|
|
|
|
|
$map['tab_spend.promote_id'] = ['in', $ids];
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
$map['_string'] = '1<>1';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -201,39 +201,39 @@ class QueryController extends BaseController
|
|
|
|
|
//
|
|
|
|
|
// $map['tab_user.promote_id'] = ['in', $childPromoteIds];
|
|
|
|
|
// }
|
|
|
|
|
// $map['tab_user.promote_id'] = ['like','%'.PID.'/'.'%'];
|
|
|
|
|
$map1['chain'] = ['like','%'.PID.'/'.'%'];
|
|
|
|
|
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
|
|
|
|
|
// $map['tab_user.promote_id'] = ['like','%'.PID.'/'.'%'];
|
|
|
|
|
$map1['chain'] = ['like', '%' . PID . '/' . '%'];
|
|
|
|
|
$rs = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select();
|
|
|
|
|
$childPromoteIds = '';
|
|
|
|
|
if(empty($rs)) {
|
|
|
|
|
if (empty($rs)) {
|
|
|
|
|
$map['tab_user.promote_id'] = PID;
|
|
|
|
|
}else {
|
|
|
|
|
foreach ($rs as $rsKey => $rsValue) {
|
|
|
|
|
} else {
|
|
|
|
|
foreach ($rs as $rsKey => $rsValue) {
|
|
|
|
|
$id = $rsValue['id'];
|
|
|
|
|
$childPromoteIds .= $id.',';
|
|
|
|
|
$childPromoteIds .= $id . ',';
|
|
|
|
|
}
|
|
|
|
|
$childPromoteIds = rtrim($childPromoteIds, ',');
|
|
|
|
|
$childPromoteIds .= ',' . PID;
|
|
|
|
|
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
|
|
|
|
|
$childPromoteIds = rtrim($childPromoteIds, ',');
|
|
|
|
|
$childPromoteIds .= ',' . PID;
|
|
|
|
|
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$levelPromote = I('level_promote', []);
|
|
|
|
|
$promote = $this->getLoginPromote();
|
|
|
|
|
$queryPromote = $this->getQueryPromote($levelPromote);
|
|
|
|
|
$map2['chain'] = ['like', $queryPromote['chain'].$queryPromote['id'].'/%'];
|
|
|
|
|
$map2['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
|
|
|
|
|
$ids = M('promote', 'tab_')->where($map2)->getField('id', true);
|
|
|
|
|
if(empty($ids)) {
|
|
|
|
|
$ids = array();
|
|
|
|
|
if (empty($ids)) {
|
|
|
|
|
$ids = array();
|
|
|
|
|
}
|
|
|
|
|
if(empty($levelPromote)) {
|
|
|
|
|
array_push($ids,PID);
|
|
|
|
|
if (empty($levelPromote)) {
|
|
|
|
|
array_push($ids, PID);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
array_push($ids,$queryPromote['id']);
|
|
|
|
|
array_push($ids, $queryPromote['id']);
|
|
|
|
|
if (!empty($ids)) {
|
|
|
|
|
$map['tab_user.promote_id'] = ['in',$ids];
|
|
|
|
|
$map['tab_user.promote_id'] = ['in', $ids];
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
$map['_string'] = '1<>1';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1062,7 +1062,7 @@ class QueryController extends BaseController
|
|
|
|
|
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
|
|
|
|
|
$begTime = strtotime($initBegTime);
|
|
|
|
|
$endTime = strtotime($initEndTime);
|
|
|
|
|
$levelPromote = I('level_promote', []);
|
|
|
|
|
$levelPromote = $this->getLevelPromote();
|
|
|
|
|
$queryPromote = $this->getQueryPromote($levelPromote);
|
|
|
|
|
|
|
|
|
|
$loginPromote = $this->getLoginPromote();
|
|
|
|
@ -1302,6 +1302,9 @@ class QueryController extends BaseController
|
|
|
|
|
|
|
|
|
|
public function summary()
|
|
|
|
|
{
|
|
|
|
|
$page = intval(I('get.p', 1));
|
|
|
|
|
$page = $page ? $page : 1; //默认显示第一页数据arraypage
|
|
|
|
|
$row = intval(I('get.row', 10));
|
|
|
|
|
$relationGameId = intval(I('relation_game_id', 0));
|
|
|
|
|
$sdkVersion = intval(I('sdk_version', 0));
|
|
|
|
|
$serverId = intval(I('server_id'), 0);
|
|
|
|
@ -1312,9 +1315,20 @@ class QueryController extends BaseController
|
|
|
|
|
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
|
|
|
|
|
$begTime = strtotime($initBegTime);
|
|
|
|
|
$endTime = strtotime($initEndTime);
|
|
|
|
|
$levelPromote = I('level_promote', []);
|
|
|
|
|
$levelPromote = $this->getLevelPromote();
|
|
|
|
|
$queryPromote = $this->getQueryPromote($levelPromote);
|
|
|
|
|
|
|
|
|
|
empty($relationGameId) || $parameter['relation_game_id'] = $relationGameId;
|
|
|
|
|
empty($sdkVersion) || $parameter['sdk_version'] = $sdkVersion;
|
|
|
|
|
empty($serverId) || $parameter['server_id'] = $serverId;
|
|
|
|
|
$parameter['level_promote_2'] = $levelPromote[0];
|
|
|
|
|
$parameter['level_promote_3'] = $levelPromote[1];
|
|
|
|
|
$parameter['level_promote_4'] = $levelPromote[2];
|
|
|
|
|
$parameter['begtime'] = $initBegTime;
|
|
|
|
|
$parameter['endtime'] = $initEndTime;
|
|
|
|
|
$parameter['p'] = $page;
|
|
|
|
|
$parameter['row'] = $row;
|
|
|
|
|
|
|
|
|
|
$loginPromote = $this->getLoginPromote();
|
|
|
|
|
|
|
|
|
|
$map = [];
|
|
|
|
@ -1359,14 +1373,20 @@ class QueryController extends BaseController
|
|
|
|
|
$userGameLoginModel = M('UserGameLoginRecord', 'tab_');
|
|
|
|
|
$spendModel = M('Spend', 'tab_');
|
|
|
|
|
|
|
|
|
|
$query = M('Apply', 'tab_')->alias('a')
|
|
|
|
|
$data = M('Apply', 'tab_')->alias('a')
|
|
|
|
|
->field('a.game_id,a.game_name,a.sdk_version')
|
|
|
|
|
->join('tab_game as g on g.id = a.game_id')
|
|
|
|
|
->join($serverJoin)
|
|
|
|
|
->where($map)
|
|
|
|
|
->group('a.game_id')
|
|
|
|
|
->order('g.sort desc,g.id desc');
|
|
|
|
|
list($records, $pagination, $count) = $this->paginate($query);
|
|
|
|
|
->order('g.sort desc,g.id desc')
|
|
|
|
|
->page($page, $row)
|
|
|
|
|
->select();
|
|
|
|
|
$count = M('Apply', 'tab_')->alias('a')
|
|
|
|
|
->join('tab_game as g on g.id = a.game_id')
|
|
|
|
|
->join($serverJoin)
|
|
|
|
|
->where($map)
|
|
|
|
|
->count('distinct a.game_id');
|
|
|
|
|
|
|
|
|
|
$allData['role_num'] = 0;
|
|
|
|
|
$allData['user_num'] = 0;
|
|
|
|
@ -1382,8 +1402,8 @@ class QueryController extends BaseController
|
|
|
|
|
$allData['pay_amount'] = 0;
|
|
|
|
|
$allData['spend_discount'] = 0;
|
|
|
|
|
$allData['spend_voucher'] = 0;
|
|
|
|
|
if (!empty($records)) {
|
|
|
|
|
foreach ($records as &$list) {
|
|
|
|
|
if (!empty($data)) {
|
|
|
|
|
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'];
|
|
|
|
@ -1478,12 +1498,15 @@ class QueryController extends BaseController
|
|
|
|
|
|
|
|
|
|
$serverData = $this->getServer($relationGameId, $sdkVersion);
|
|
|
|
|
|
|
|
|
|
$page = set_pagination($count, $row, $parameter);
|
|
|
|
|
if ($page) {
|
|
|
|
|
$this->assign('_page', $page);
|
|
|
|
|
}
|
|
|
|
|
$this->assign('meta_title', '数据汇总列表');
|
|
|
|
|
$this->assign('loginPromote', $loginPromote);
|
|
|
|
|
$this->assign('ownId', $ownId);
|
|
|
|
|
$this->assign('allData', $allData);
|
|
|
|
|
$this->assign('listData', $records);
|
|
|
|
|
$this->assign('pagination', $pagination);
|
|
|
|
|
$this->assign('listData', $data);
|
|
|
|
|
$this->assign('count', $count);
|
|
|
|
|
$this->assign('setdate', date("Y-m-d"));
|
|
|
|
|
$this->assign('initBegTime', $initBegTime);
|
|
|
|
|