Merge branch 'feature/promote_order_settle_check' of wmtx/platform into release

推广员结算订单归属
master
廖金灵 4 years ago committed by Gogs
commit 671822f4c5

@ -20,7 +20,7 @@ class PromoteRepository {
/**
* 获取业绩公共map
*/
private function getPublicAchievementMap($ids, $params)
private function getPublicAchievementMap($ids, $params, $type = null)
{
$isContainSubs = false;
if (isset($params['isContainSubs']) && $params['isContainSubs']) {
@ -51,6 +51,10 @@ class PromoteRepository {
if (isset($params['begin_time']) && isset($params['end_time']) && isset($params['time_column'])) {
$map[$params['time_column']] = ['between', [$params['begin_time'], $params['end_time']]];
}
if ($type == 'spend') {
$spendRepository = new SpendRepository();
$map = $spendRepository->withIsCheck($map);
}
if (isset($params['lock_status'])) {
$lockUserIds = M('user', 'tab_')->where(['lock_status' => 0, 'promote_id' => ['in', $allIds]])->getField('id', 'true');
if (count($lockUserIds) > 0) {
@ -308,7 +312,7 @@ class PromoteRepository {
}
$params['time_column'] = 'pay_time';
$map = $this->getPublicAchievementMap($ids, $params);
$map = $this->getPublicAchievementMap($ids, $params, 'spend');
$items = M('spend', 'tab_')->field(['count(*) count', 'promote_id'])->where($map)->group('promote_id')->select();
@ -340,7 +344,7 @@ class PromoteRepository {
}
$params['time_column'] = 'pay_time';
$map = $this->getPublicAchievementMap($ids, $params);
$map = $this->getPublicAchievementMap($ids, $params, 'spend');
$items = M('spend', 'tab_')->field(['count(distinct user_id) count', 'promote_id'])->where($map)->group('promote_id')->select();
$records = [];
@ -371,7 +375,7 @@ class PromoteRepository {
}
$params['time_column'] = 'pay_time';
$map = $this->getPublicAchievementMap($ids, $params);
$map = $this->getPublicAchievementMap($ids, $params, 'spend');
$map['pay_status'] = 1;
$items = M('spend', 'tab_')->field(['sum(pay_amount) amount', 'promote_id', 'pay_way'])->where($map)->group('promote_id, pay_way')->select();
// echo M()->getLastSql();die();

@ -43,6 +43,8 @@ class SpendRepository
$conditions['pay_status'] = 1;
$conditions['pay_time'] = ['between', [$beginTime, $endTime]];
$conditions = $this->withIsCheck($conditions);
return $conditions;
}
@ -65,6 +67,8 @@ class SpendRepository
}
$conditions['pay_time'] = ['between', [$beginTime, $endTime]];
$conditions = $this->withIsCheck($conditions);
return $conditions;
}
@ -85,6 +89,9 @@ class SpendRepository
if (isset($params['server_id'])) {
$conditions['server_id'] = $serverId;
}
$conditions = $this->withIsCheck($conditions);
$conditions['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1'];
return $conditions;
}
@ -108,6 +115,9 @@ class SpendRepository
if (isset($params['pay_way'])) {
$conditions['pay_way'] = $params['pay_way'];
}
$conditions = $this->withIsCheck($conditions);
return $conditions;
}
@ -370,8 +380,8 @@ class SpendRepository
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}
public function getCommonQuery($params, $columns = '*')
public function withIsCheck($map, $column = 'is_check')
{
// return M('spend', 'tab_')->field($columns)->where($map);
return array_merge($map, [$column => 1]);
}
}

@ -290,6 +290,7 @@ class TestingResourceRepository
}
}
$spendItems = [];
if (count($bindingRoles) > 0) {
$spendOrWhere = [];
@ -300,13 +301,18 @@ class TestingResourceRepository
'pay_status' => 1,
'_string' => '(' . implode(' or ', $spendOrWhere) . ')',
];
$subBindingCondition = [
'_string' =>
'tab_testing_binding.bind_role_id = tab_spend.game_player_id and ' .
'tab_testing_binding.game_id = tab_spend.game_id and ' .
'UNIX_TIMESTAMP(FROM_UNIXTIME(tab_testing_binding.create_time, "%Y-%m-%d 00:00:00")) <= tab_spend.pay_time'
];
$spendRepository = new SpendRepository();
$subBindingCondition = $spendRepository->withIsCheck($subBindingCondition, 'tab_spend.is_check');
$spendCondition = $spendRepository->withIsCheck($spendCondition);
$subBindingSql = M('testing_binding', 'tab_')
->where([
'_string' =>
'tab_testing_binding.bind_role_id = tab_spend.game_player_id and ' .
'tab_testing_binding.game_id = tab_spend.game_id and ' .
'UNIX_TIMESTAMP(FROM_UNIXTIME(tab_testing_binding.create_time, "%Y-%m-%d 00:00:00")) <= tab_spend.pay_time'
])
->where($subBindingCondition)
->select(false);
$spendCondition['_string'] .= ' and exists(' . $subBindingSql . ')';
$spendList = M('spend', 'tab_')

@ -2,6 +2,7 @@
namespace Base\Service;
use Base\Facade\Request;
use Base\Repository\SpendRepository;
class PromoteGradeService
{
@ -153,12 +154,15 @@ class PromoteGradeService
'_string' => 'user_id in (' . $userSubSql . ')'
];
$spendRepository = new SpendRepository();
$spendMap = [
'pay_time' => ['between', $betweenTime],
'pay_status' => 1,
'promote_id' => ['in', $promoteIds],
'_string' => 'user_id in (' . $userSubSql . ')'
];
$spendMap = $spendRepository->withIsCheck($spendMap);
if ($baseGame) {
$roleMap['game_id'] = ['in', [$baseGame['android_game_id'], $baseGame['ios_game_id']]];

@ -8,6 +8,7 @@ use Base\Model\UserModel;
use Base\Tool\IdCard;
use Base\Tool\Registry;
use Think\Model;
use Base\Repository\SpendRepository;
class PromoteService {
@ -338,7 +339,7 @@ class PromoteService {
$users = M('user', 'tab_')->field(['id', 'account', 'nickname'])->where($map)->select();
$spendMap['pay_time'] = ['egt', $orderTime];
$spendMap['is_check'] = ['in','1,2'];
// $spendMap['is_check'] = ['in','1,2'];
$spendMap['settle_check'] = 0;
$spendMap['selle_status'] = 0;
$spendMap['pay_status'] = 1;
@ -1233,6 +1234,27 @@ class PromoteService {
}
}
/**
* 推广员所属公会历史所有推广过的游戏ID
* @todo 如果没有用户充值则该游戏ID不会显示
*/
public function getHistoryGameIds($promote)
{
$topPromote = $this->getTopPromote($promote);
$spendRepository = new SpendRepository();
$map = [];
$map['_string'] = ' promote_id in(' . $this->subInSql($topPromote) . ')';
$map = $spendRepository->withIsCheck($map);
$historyGameIds = M('spend', 'tab_')->field(['distinct game_id'])->where($map)->getField('game_id', true);
if (!$historyGameIds) {
$historyGameIds = [];
}
$nowGameIds = $topPromote['game_ids'] == '' ? [] : explode(',', $topPromote['game_ids']);
return array_unique(array_merge($historyGameIds, $nowGameIds));
}
public function checkPromoteLimitRule($promote)
{
$topPromote = $this->getTopPromote($promote);

@ -4,6 +4,7 @@ namespace Base\Service;
use Base\Facade\Request;
use Base\Tool\GameResource;
use Base\Repository\TestingResourceRepository;
use Base\Repository\SpendRepository;
use Think\Model;
class TestingResourceService
@ -154,13 +155,18 @@ class TestingResourceService
$totalQuota = $role['testing_other_quota'] + ($gameSetting['base_quota'] ?? 0);
if (!is_null($bindRole)) {
$bindTime = $bindRole['binding_time'] ?? 0;
$spendMap = [
'game_id' => $role['game_id'],
'game_player_id' => $bindRole['role_id'],
'pay_status' => 1,
'pay_time' => ['egt', strtotime(date('Y-m-d 00:00:00', $bindTime))]
];
$spendRepository = new SpendRepository();
$spendMap = $spendRepository->withIsCheck($spendMap);
$spendQuota += M('spend', 'tab_')
->where([
'game_id' => $role['game_id'],
'game_player_id' => $bindRole['role_id'],
'pay_status' => 1,
'pay_time' => ['egt', strtotime(date('Y-m-d 00:00:00', $bindTime))]
])
->where($spendMap)
->group('game_id,game_player_id')
->sum('pay_amount');
$totalQuota += round($gameSetting['rate'] / 100 * $spendQuota, 2);

@ -1385,4 +1385,32 @@ function data2csv(&$data,$title,$fields){
ob_flush();
fclose($fp); //每生成一个文件关闭
die();
}
function is_active_menu(array $controllers, array $actions, \Closure $otherCondition = null)
{
$controllerStatus = true;
$actionStatus = true;
$otherConditionStatus = true;
if ($controllers && !in_array(CONTROLLER_NAME, $controllers)) {
$controllerStatus = false;
}
if ($actions && !in_array(ACTION_NAME, $actions)) {
$actionStatus = false;
}
if ($otherCondition) {
$otherConditionStatus = $otherCondition();
}
if ($controllerStatus && $actionStatus && $otherConditionStatus) {
return true;
}
return false;
}
function is_active_class(array $controllers, array $actions, \Closure $otherCondition = null)
{
if (is_active_menu($controllers, $actions, $otherCondition)) {
return 'active';
}
return '';
}

@ -18,7 +18,8 @@ use GuzzleHttp\Client;
/**
* @author elf<360197197@qq.com>
*/
class DownloadController extends BaseController {
class DownloadController extends BaseController
{
public $payWay = [
-1 => '绑币',
0 => '平台币',
@ -46,6 +47,14 @@ class DownloadController extends BaseController {
0 => '下单未支付',
1 => '充值成功',
];
public $spendRepository;
protected function _initialize()
{
parent::_initialize();
$this->spendRepository = new SpendRepository();
}
/**
* excel
@ -1491,8 +1500,6 @@ class DownloadController extends BaseController {
empty(I('game_player_name')) || $map['tab_spend.game_player_name'] = ['like', '%' . I('game_player_name') . '%'];
empty(I('user_account')) || $map['tab_spend.user_account'] = ['like', '%' . I('user_account') . '%'];
empty(I('pay_order_number')) || $map['tab_spend.pay_order_number'] = I('pay_order_number');
// $map['tab_spend.pay_status'] = 1;
// $map['tab_spend.is_check'] = ['neq', 2];
if (isset($_REQUEST['pay_status']) && $_REQUEST['pay_status'] !== '') {
$payStatus = intval(I('pay_status'));
@ -1500,9 +1507,12 @@ class DownloadController extends BaseController {
$map['tab_spend.pay_status'] = $payStatus + 2;
}
}
$conditions = json_encode($map,TRUE);
$addtime = time();
$data = [
$map = $this->spendRepository->withIsCheck($map, 'tab_spend.is_check');
$conditions = json_encode($map, true);
$addtime = time();
$data = [
'logid' => 'cz_'.time(),
'promote_id' => PID,
'type' => '/Home/Query/recharge',
@ -2234,6 +2244,8 @@ class DownloadController extends BaseController {
}
}
$spendMap = $this->spendRepository->withIsCheck($spendMap);
$spendSubSql = M('spend', 'tab_')->field(['game_id', 'server_id', 'sum(pay_amount) amount'])->where($spendMap)->group('game_id, server_id')->select(false);
$roleSubSql = M('user_play_info', 'tab_')->field(['game_id', 'server_id', 'count(*) count'])->where($roleMap)->group('game_id, server_id')->select(false);
@ -2267,92 +2279,64 @@ class DownloadController extends BaseController {
* 数据汇总添加下载
* @author sunke
*/
public function summary_data_export() {
$promoteId = I('promote_id',0);
$teamLeaderId = I('team_leader_id',0);
$own_id = I('own_id',0);
$relation_game_id = I('relation_game_id',0);
$sdk_version = I('sdk_version',0);
$begtime = I('begtime','');
$endtime = I('endtime','');
// $childPromoteIds = getAllChildPromoteList(3);
$map1['chain'] = ['like','%'.'/'.PID.'/'.'%'];
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = '';
if(empty($rs)) {
$map['tab_apply.promote_id'] = PID;
}else {
foreach ($rs as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id.',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_apply.promote_id'] = ['in', $childPromoteIds];
}
public function summary_data_export()
{
$ownId = intval(I('own_id'), 0);//本账号
$relationGameId = intval(I('relation_game_id', 0));
$sdkVersion = intval(I('sdk_version', 0));
$serverId = I('server_id', '');
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$endTime += 3600 * 24;
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$map2[] = [
'_logic' => 'or',
'id' => $queryPromote['id'],
'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']
];
$ids = M('promote', 'tab_')->where($map2)->getField('id', true);
if(empty($ids)) {
$ids = array();
}
if(empty($levelPromote)) {
array_push($ids,PID);
}
// array_push($ids,$queryPromote['id']);
if (!empty($ids)) {
$map['tab_apply.promote_id'] = ['in',$ids];
}else {
$map['_string'] = '1<>1';
}
if (!empty($own_id)) {
if (!empty($map['_string'])) {
unset($map['_string']);
}
$map['tab_apply.promote_id'] = $queryPromote['id'];//本账号
$loginPromote = $this->getLoginPromote();
$params = [];
$map = [];
$map = ['_string' => '1=1'];
if ($ownId) {
$params['promote_ids'] = $queryPromote['id'];
} else {
$subMap['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($subMap)->getField('id', true);
$ids[] = $queryPromote['id'];
$params['promote_ids'] = $ids;
}
empty($relation_game_id) || $map['tab_game.relation_game_id'] = $relation_game_id;
empty($sdk_version) || $map['tab_game.sdk_version'] = $sdk_version;
if(empty($begtime) && empty($endtime)) {
$nowTime = date('Y-m-d');
$begtime1 = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$endtime1 = $nowTime;
$map["apply_time"] = ["between",[strtotime($begtime1),strtotime($endtime1) + 3600*24]];
if ($relationGameId > 0) {
$map['relation_game_id'] = $relationGameId;
}
if(!empty($begtime) && !empty($endtime)) {
$map["apply_time"] = ["between",[strtotime($begtime),strtotime($endtime) + 3600 * 24]];
if ($sdkVersion > 0) {
$map['sdk_version'] = $sdkVersion;
}
$serverField = '';
$serverJoin = '';
if (!empty(I('server_id'))) {
$map['tab_server.id'] = I('server_id');
if (!empty($serverId)) {
$params['server_id'] = $serverId;
}
$conditions = json_encode($map,TRUE);
$addtime = time();
$data = [
'logid' => 'hz_'.time(),
'promote_id' => PID,
'type' => '/Home/Query/summary',
'dataname' => '数据汇总数据',
'status' => 0,
'addtime' => $addtime,
'begintime' => 0,
'content' => '',
'conditions' =>$conditions
];
$res = M('downloadlog','tab_')->add($data);
if (!$res) {
$params['begin_time'] = $begTime;
$params['end_time'] = $endTime - 1;
$conditions = json_encode(['map' => $map, 'params' => $params], true);
$addtime = time();
$data = [
'logid' => 'hz_'.time(),
'promote_id' => PID,
'type' => '/Home/Query/summary',
'dataname' => '数据汇总数据',
'status' => 0,
'addtime' => $addtime,
'begintime' => 0,
'content' => '',
'conditions' =>$conditions
];
$res = M('downloadlog','tab_')->add($data);
if (!$res) {
// $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res));
$this->error('添加下载失败');
}
@ -3184,7 +3168,7 @@ public function iosDetailExcelInfo($id,$map) {
}
//数据汇总excel信息
public function summaryExcelInfo($id,$map) {
public function summaryExcelInfo($id, $map) {
$xlsName = "数据汇总";
$xlsCell = array(
array('game_name','游戏名称'),
@ -3207,51 +3191,26 @@ public function iosDetailExcelInfo($id,$map) {
$xlsCell[] = array('spend_discount','折扣币充值');
$xlsCell[] = array('spend_voucher','代金券使用');
}
if(!empty($map['tab_apply.promote_id'][1])) {
$params['promote_ids'] = $map['tab_apply.promote_id'][1];
$loginPromote = $this->getLoginPromote();
$map = json_decode(json_encode($map), true);
$gameMap = $map['map'];
$params = $map['params'];
$promoteService = new PromoteService();
$allGameIs = $promoteService->getHistoryGameIds($loginPromote);
if ($allGameIs && count($allGameIs) > 0) {
$gameMap['_string'] .= ' and id in(' . implode(',', $allGameIs) . ')';
} else {
$gameMap['_string'] .= '1=0';
}
$serverJoin = '';
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$params['begin_time'] = $begTime;
$params['end_time'] = $endTime -1;
if(!empty($map['apply_time'][1])) {
$begTime = $map['apply_time'][1][0];
$endTime = $map['apply_time'][1][1];
$params['begin_time'] = $begTime;
$params['end_time'] = $endTime -1;
unset($map['apply_time']);
}
if(!empty($map['tab_server.server_id'])) {
$serverJoin = 'tab_server on tab_server.game_id = tab_apply.game_id';
$params['server_id'] = $map['tab_server.server_id'];
}
$data = M('Apply', 'tab_')
->field('tab_apply.game_id,tab_apply.game_name,tab_apply.sdk_version')
->join('tab_game as g on g.id = tab_apply.game_id')
->join($serverJoin)//关联区服表
->where($map)
->group('tab_apply.game_id')
->order('g.sort desc,g.id desc')
->select();
$allGameIs = M('Apply', 'tab_')
->field('distinct tab_apply.game_id')
->join('tab_game as g on g.id = tab_apply.game_id')
->join($serverJoin)
->where($map)
->select();
$allGameIs = array_column($allGameIs, 'game_id');
$data = M('game', 'tab_')->where($gameMap)->order('sort desc,id desc')->select();
$records = [];
if (!empty($data)) {
if (intval($endTime - $begTime) / (24 * 3600) <= 31) {
$gameIds = [];
foreach ($data as $list) {
$gameIds[] = $list['game_id'];
}
$gameIds = array_column($data, 'id');
$params['game_ids'] = $gameIds;
$userRepository = new UserRepository();
$spendRepository = new SpendRepository();
@ -3261,36 +3220,43 @@ public function iosDetailExcelInfo($id,$map) {
$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) {
if ($this->canViewUserRecharge) {
$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) {
$gameId = $list['game_id'];
$records[] = [
$record = [
'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,
'sdk_version' => $list['sdk_version'] == 1 ? '安卓' : '苹果',
'role_num' => intval($roleNumList[$gameId]),
'user_num' => intval($userNumList[$gameId]),
'new_user_num' => intval($newUserNumList[$gameId]),
'new_device_num' => intval($newDeviceNumList[$gameId]),
'new_ip_num' => intval($newIpNumList[$gameId]),
'login_user_num' => intval($loginUserNumList[$gameId]),
];
if ($this->canViewUserRecharge) {
if ($this->canViewUserRecharge) {
$record['spend_user_num'] = intval($spendUserNumList[$gameId]);
$record['spend_num'] = intval($spendNumList[$gameId]);
$record['spend_all_amount'] = $spendAllAmountList[$gameId];
$record['spend_cash'] = $spendCashList[$gameId];
$record['spend_generic'] = $spendGenericList[$gameId];
$record['spend_binding'] = $spendBindingList[$gameId];
$record['spend_discount'] = 0;
$record['spend_voucher'] = 0;
}
}
$records[] = $record;
}
$params['all_data'] = 1;
$params['game_ids'] = $allGameIs;
@ -3304,14 +3270,6 @@ public function iosDetailExcelInfo($id,$map) {
$allData['login_user_num'] = $userRepository->getLoginCountGroupByGame($params);//登录用户数
if($this->canViewUserRecharge) {
$record['spend_user_num'] = $spendUserNumList[$gameId];
$record['spend_num'] = $spendNumList[$gameId];
$record['spend_all_amount'] = $spendAllAmountList[$gameId];
$record['spend_cash'] = $spendCashList[$gameId];
$record['spend_generic'] = $spendGenericList[$gameId];
$record['spend_binding'] = $spendBindingList[$gameId];
$record['spend_discount'] = 0;
$record['spend_voucher'] = 0;
$allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数
$allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数
unset($params['pay_way']);
@ -3326,24 +3284,10 @@ public function iosDetailExcelInfo($id,$map) {
$allData['spend_voucher'] = '0.00';
}
$records[] = $record;
$records[] = $allData;
}
}
$xlsData = [];
foreach ($records as $key1 => $value1) {
if($value1["sdk_version"] == 1) {
$value1["sdk_version"] = "安卓";
}
if($value1["sdk_version"] == 2) {
$value1["sdk_version"] = "苹果";
}
$xlsData[] = $value1;
}
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id);
$this->exportExcel($xlsName, $xlsCell, $records,$id);
}
/*
@ -4476,6 +4420,9 @@ public function iosDetailExcelInfo($id,$map) {
$spendMap['today.pay_status'] = 1;
$spendMap['today.pay_time'] = ['between', [$now, $nowTimeEnd]];
$map = $this->spendRepository->withIsCheck($map, 'uc.is_check');
$spendMap = $this->spendRepository->withIsCheck($spendMap, 'today.is_check');
$fieldToday = M('spend', 'tab_')->alias('today')
->field('sum(pay_amount) as recharge_cost_today')
->where($spendMap)

@ -24,6 +24,14 @@ class FinanceController extends BaseController
2 => '已汇款',
];
public $spendRepository;
protected function _initialize()
{
parent::_initialize();
$this->spendRepository = new SpendRepository();
}
//权限过滤
private function purview()
{
@ -127,6 +135,7 @@ class FinanceController extends BaseController
$map = [];
$map['pay_status'] = 1;
$map['promote_id'] = ['in', $promoteIds];
$map = $this->spendRepository->withIsCheck($map);
$income = $model->field("sum(if(pay_time < $thisDay, if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as history_income,
sum(if(pay_time >= $thisMonth, if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as this_month_income,
sum(if((pay_time >= $yesterday and pay_time < $thisDay), if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as yesterday_income,
@ -215,6 +224,7 @@ class FinanceController extends BaseController
} else {
$map['pay_status'] = 1;
$map['selle_status'] = 0;
$map = $this->spendRepository->withIsCheck($map);
$balance = M('spend', 'tab_')->field('sum(pay_amount * selle_ratio) as balance')->where($map)->find()['balance'];
$balance = $balance ? bcdiv($balance , 100, 2) : 0;
$settlementType = 3;
@ -290,7 +300,7 @@ class FinanceController extends BaseController
private function getSumMoney($map = [])
{
$map['pay_status'] = 1;
$map = $this->spendRepository->withIsCheck($map);
$sumAmount = M('spend', 'tab_')->field('sum(pay_amount) as sum_amount')->where($map)->find()['sum_amount'];
$sumAmount = $sumAmount ?? 0;
return $sumAmount;
@ -396,7 +406,7 @@ class FinanceController extends BaseController
}
}
}
$map = $this->spendRepository->withIsCheck($map);
$data = $model->field('pay_order_number,game_name,user_account,promote_id,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id')
->where($map)
->order('id desc')
@ -505,6 +515,9 @@ class FinanceController extends BaseController
$map['selle_status'] = 0;
$map['promote_id'] = ['in', $promoteIds];
$map['pay_time'] = ['lt', $thisDay];
$map = $this->spendRepository->withIsCheck($map);
$balance = $spendModel->field("sum(pay_amount * selle_ratio) as balance")
->where($map)
->find()['balance'];
@ -742,6 +755,8 @@ class FinanceController extends BaseController
$map['pay_order_number'] = $payOrderNumber;
}
$map = $this->spendRepository->withIsCheck($map);
$data = $spendModel
->field('id,pay_order_number,game_name,sdk_version,user_account,pay_amount,pay_way,selle_ratio,pay_time')
->where($map)
@ -896,6 +911,9 @@ class FinanceController extends BaseController
$this->ajaxReturn($data);
}
$spendMap = [];
$spendMap = $this->spendRepository->withIsCheck($spendMap);
$spendMap['withdraw_id'] = $id;
$spendIds = M('Spend', 'tab_')->where($spendMap)->getField('id', true);
if (empty($spendIds)) {

@ -25,7 +25,7 @@ use Home\Model\UserPlayModel;
use Home\Model\PromoteModel;
use Base\Service\PromoteService;
use Base\Service\ApplyService;
use Base\Repository\SpendRepository;
use Org\RedisSDK\Redis;
/**
@ -34,6 +34,15 @@ use Org\RedisSDK\Redis;
*/
class PromoteController extends BaseController
{
public $spendRepository;
protected function _initialize()
{
parent::_initialize();
$this->spendRepository = new SpendRepository();
}
//系统首页
public function index($p = 1)
{
@ -132,11 +141,6 @@ class PromoteController extends BaseController
$promoteId = array(get_pid());
//计算当日用户充值数据
// $map['_string'] = "promote_id = {$promote_id} or tab_promote.parent_id = {$promote_id} or tab_promote.grand_id = {$promote_id} ";
//计算当日用户充值数据
// $map['_string'] = "promote_id = {$promote_id} or tab_promote.parent_id = {$promote_id} or tab_promote.chain like '%/{$promote_id}/%' ";
$pay_time = " between 0 and " . time();
$spendData = $this->caculateSpend($pay_time, []);
@ -169,22 +173,6 @@ class PromoteController extends BaseController
->order('count desc, register_time')
->find();
// $data = M('User', 'tab_')
// ->field('promote_account,promote_id,date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(tab_user.id) as count,
// IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,promote_id)) as promote_id1 ,
// count(IF(register_time ' . $yesterdays . ',1,null)) as yesterday,
// count(IF(register_time ' . $today . ',1,null)) as today,
// count(IF(register_time ' . $week . ',1,null)) as week,
// count(IF(register_time ' . $mounth . ',1,null)) as mounth')
// ->join('tab_promote on promote_id = tab_promote.id', 'left')
// ->where($map)
// ->group('promote_id1')
// ->having('promote_id != 0')
// ->order('count desc,register_time')
// ->find();
// var_dump($data);die();
// echo M('promote', 'tab_')->_sql();die();
$total_money = $this->pay_total(0, 0, $promoteId);
$today_add_user_money = $this->pay_total(1, 1, $promoteId);
$month_add_user_money = $this->pay_total(3, 1, $promoteId);
@ -194,8 +182,6 @@ class PromoteController extends BaseController
//计算昨天用户的统计数据,当日用户充值数据
$pay_time = " between {$yesterday_start} and {$yesterday_end}";
$createTime = ['between', array($yesterday_start, $yesterday_end - 1)];
// $yesterdaySpendData = $this->caculateSpend($pay_time, []);
// var_dump($yesterdaySpendData);die();
$todayAddSpendData = $this->caculateSpend($pay_time, [], [], 1);
@ -217,9 +203,7 @@ class PromoteController extends BaseController
$today_total_money = $this->pay_total(1, 0, $promoteId);
$this->assign('data', $data);
// $this->assign('yesterdayData',$yesterdayData);
$this->assign('spendData', $spendData);
// $this->assign('yesterdaySpendData', $yesterdaySpendData);
$this->assign('todayAddSpendData', $todayAddSpendData);
$this->assign('mounthAddSpendData', $mounthAddSpendData);
@ -424,6 +408,9 @@ class PromoteController extends BaseController
$promoteIds[] = $promoteId;
$map['promote_id'] = ['IN', $promoteIds];
$map = $this->spendRepository->withIsCheck($map);
if (in_array($type, [1, 2])) {
$whereUser['promote_id'] = $map['promote_id'];
if ($type == 1) {
@ -508,7 +495,7 @@ class PromoteController extends BaseController
}
$where['spend.promote_id'] = array('in', $promoteId);
$where['spend.pay_status'] = 1;
$where['spend.is_check'] = array('NEQ', 2);
$where = $this->spendRepository->withIsCheck($where, 'spend.is_check');
switch ($type) {
case 1:
{ // 今天

@ -17,6 +17,15 @@ use Base\Repository\GameRepository;
*/
class QueryController extends BaseController
{
public $spendRepository;
protected function _initialize()
{
parent::_initialize();
$this->spendRepository = new SpendRepository();
}
public static $payWay = [
-1 => '绑币',
0 => '平台币',
@ -127,6 +136,8 @@ class QueryController extends BaseController
if ($payedBegTime && $payedEndTime) {
$map['tab_spend.payed_time'] = ['between', [$payedBegTime, $payedEndTime - 1]];
}
$map = $this->spendRepository->withIsCheck($map, 'tab_spend.is_check');
$data = [];
$count = 0;
@ -1291,61 +1302,44 @@ class QueryController extends BaseController
$loginPromote = $this->getLoginPromote();
$map = [];
$map = ['_string' => '1=1'];
if ($ownId) {
$map['a.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);
$subMap['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($subMap)->getField('id', true);
$ids[] = $queryPromote['id'];
$map = [];
$map['a.promote_id'] = ['in', $ids];
$params['promote_ids'] = $ids;
}
if ($relationGameId > 0) {
$map['g.relation_game_id'] = $relationGameId;
$map['relation_game_id'] = $relationGameId;
}
if ($sdkVersion > 0) {
$map['a.sdk_version'] = $sdkVersion;
$map['sdk_version'] = $sdkVersion;
}
$serverJoin = '';
if (!empty($serverId)) {
$serverJoin = 'tab_server as s on s.game_id = a.game_id';
$map['s.server_id'] = $serverId;
$params['server_id'] = $serverId;
}
$params['begin_time'] = $begTime;
$params['end_time'] = $endTime - 1;
$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')
->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');
$allGameIs = M('Apply', 'tab_')->alias('a')
->field('distinct a.game_id')
->join('tab_game as g on g.id = a.game_id')
->join($serverJoin)
->where($map)
->select();
$allGameIs = array_column($allGameIs, 'game_id');
$promoteService = new PromoteService();
$allGameIs = $promoteService->getHistoryGameIds($loginPromote);
if ($allGameIs && count($allGameIs) > 0) {
$map['_string'] .= ' and id in(' . implode(',', $allGameIs) . ')';
} else {
$map['_string'] .= '1=0';
}
$data = M('game', 'tab_')->where($map)->order('sort desc,id desc')->page($page, $row)->select();
$count = M('game', 'tab_')->where($map)->count();
$records = [];
$allData = [];
if (!empty($data)) {
if (intval($endTime - $begTime) / (24 * 3600) <= 31) {
$gameIds = array_column($data, 'game_id');
$gameIds = array_column($data, 'id');
$params['game_ids'] = $gameIds;
$userRepository = new UserRepository();
@ -1367,7 +1361,7 @@ class QueryController extends BaseController
$params['pay_way'] = -1;
$spendBindingList = $spendRepository->getPayAmountGroupByGameAndType($params);//绑定币充值
}
foreach ($data as &$list) {
foreach ($data as $list) {
$gameId = $list['game_id'];
$record = [
'game_id' => $gameId,
@ -1976,6 +1970,10 @@ class QueryController extends BaseController
$spendMap['_string'] = 'today.user_id = s.user_id and today.game_id = s.game_id and today.server_id = s.server_id and today.game_player_id = s.game_player_id and today.promote_id = s.promote_id';
$spendMap['today.pay_status'] = 1;
$spendMap['today.pay_time'] = ['between', [$nowTime, $nowTimeEnd]];
$map = $this->spendRepository->withIsCheck($map, 's.is_check');
$spendMap = $this->spendRepository->withIsCheck($spendMap, 'today.is_check');
$fieldToday = M('spend', 'tab_')->alias('today')
->field('sum(pay_amount) as recharge_cost_today')
->where($spendMap)
@ -3027,6 +3025,8 @@ class QueryController extends BaseController
$map['a.server_id'] = $serverId;
}
$spendMap = $this->spendRepository->withIsCheck($spendMap);
$spendSubSql = M('spend', 'tab_')->field(['game_id', 'server_id', 'sum(pay_amount) amount'])->where($spendMap)->group('game_id, server_id')->select(false);
$roleSubSql = M('user_play_info', 'tab_')->field(['game_id', 'server_id', 'count(*) count'])->where($roleMap)->group('game_id, server_id')->select(false);

@ -36,19 +36,30 @@
<img src="{$siteConfig['logo']}" style="height:40px;margin:0px;">
</div>
<div class="subNavBox">
<a href="{:U('Promote/index')}" class="subNav <if condition='CONTROLLER_NAME eq Promote and ACTION_NAME eq index '>active</if>"> 后台首页 </a>
<a href="{:U('Promote/index')}" class="subNav <?=is_active_class(['Promote'], ['index'])?>"> 后台首页 </a>
<?php if ($loginer['level'] < 4) :?>
<div class="subNav jssubNav"><i class="prev_icon icon_guanli"></i><span>管理中心</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<!-- <a href="{:U('Promote/base_info')}" class="<if condition='CONTROLLER_NAME eq Promote and ACTION_NAME eq base_info '>active</if> ">账户信息</a>-->
<?php
function promote_is_active_class($promoteType)
{
return is_active_class(
['Promote'],
['children', 'addPromote', 'edit_chlid'],
function() use($promoteType) {
return $_GET["promote_type"] == $promoteType;
}
);
}
?>
<?php if (in_array($loginer['level'], [1])):?>
<a href="{:U('Promote/children', ['promote_type' => 0])}" class="<if condition='$_GET["promote_type"]==0 and CONTROLLER_NAME eq Promote and (ACTION_NAME eq children or ACTION_NAME eq addPromote or ACTION_NAME eq edit_chlid) '>active</if> ">部门长管理</a>
<a href="{:U('Promote/children', ['promote_type' => 0])}" class="<?=promote_is_active_class(0)?>">部门长管理</a>
<?php endif;?>
<?php if (in_array($loginer['level'], [1, 2])):?>
<a href="{:U('Promote/children', ['promote_type' => 1])}" class="<if condition='$_GET["promote_type"]==1 and CONTROLLER_NAME eq Promote and (ACTION_NAME eq children or ACTION_NAME eq addPromote or ACTION_NAME eq edit_chlid) '>active</if> ">组长管理</a>
<a href="{:U('Promote/children', ['promote_type' => 1])}" class="<?=promote_is_active_class(1)?>">组长管理</a>
<?php endif;?>
<?php if (in_array($loginer['level'], [1, 2, 3])):?>
<a href="{:U('Promote/children', ['promote_type' => 2])}" class="<if condition='$_GET["promote_type"]==2 and CONTROLLER_NAME eq Promote and (ACTION_NAME eq children or ACTION_NAME eq addPromote or ACTION_NAME eq edit_chlid) '>active</if> ">推广员管理</a>
<a href="{:U('Promote/children', ['promote_type' => 2])}" class="<?=promote_is_active_class(2)?>">推广员管理</a>
<?php endif;?>
</div>
<?php endif;?>
@ -58,101 +69,101 @@
<?php if($isOpenQuery):?>
<div class="subNav jssubNav"><i class="prev_icon icon_shujvi"></i><span>数据管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('Query/dailySummary')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq dailySummary '>active</if> ">每日概况</a>
<a href="{:U('Query/summary')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq summary '>active</if> ">数据汇总</a>
<a href="{:U('Query/dailySummary')}" class="<?=is_active_class(['Query'], ['dailySummary'])?>">每日概况</a>
<a href="{:U('Query/summary')}" class="<?=is_active_class(['Query'], ['summary'])?>">数据汇总</a>
<?php if($canViewUserRecharge):?>
<a href="{:U('Query/recharge')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq recharge or ACTION_NAME eq viewSpendDetailed) '>active</if> ">订单查询</a>
<a href="{:U('Query/recharge')}" class="<?=is_active_class(['Query'], ['recharge', 'viewSpendDetailed'])?>">订单查询</a>
<?php endif;?>
<a href="{:U('Query/register')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq register or ACTION_NAME eq viewRole) '>active</if> ">注册明细</a>
<a href="{:U('Query/register')}" class="<?=is_active_class(['Query'], ['register', 'viewRole'])?>">注册明细</a>
<?php if($canViewUserRecharge):?>
<a href="{:U('Query/arpu')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq arpu '>active</if> ">ARPU统计</a>
<a href="{:U('Query/arpu')}" class="<?=is_active_class(['Query'], ['arpu'])?>">ARPU统计</a>
<?php endif;?>
<!-- <a href="{:U('Query/retention_analysis')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq retention_analysis '>active</if> ">留存统计</a> -->
<a href="{:U('Query/userRoles')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRoles '>active</if> ">角色查询</a>
<!-- <a href="{:U('Query/retention_analysis')}" class="<?=is_active_class(['Query'], ['retention_analysis'])?>">留存统计</a> -->
<a href="{:U('Query/userRoles')}" class="<?=is_active_class(['Query'], ['userRoles'])?>">角色查询</a>
<?php if($canViewUserRecharge):?>
<a href="{:U('Query/userRecharges')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRecharges '>active</if> ">充值玩家</a>
<a href="{:U('Query/userRecharges')}" class="<?=is_active_class(['Query'], ['userRecharges'])?>">充值玩家</a>
<?php endif;?>
<a href="{:U('Query/achievement')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq achievement '>active</if> ">团队/推广员业绩</a>
<!-- <a href="{:U('Query/promoteQuota')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq promoteQuota or ACTION_NAME eq quotaDtl) '>active</if> ">推广员指标</a> -->
<a href="{:U('Query/iosDownLoadData')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq iosDownLoadData or ACTION_NAME eq iosDownLoadData) '>active</if> ">IOS下载数统计</a>
<a href="{:U('Query/userretention')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq userretention) '>active</if> ">用户留存率</a>
<a href="{:U('Query/gameData')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq gameData) '>active</if> ">游戏分区数据汇总</a>
<a href="{:U('Query/achievement')}" class="<?=is_active_class(['Query'], ['achievement'])?>">团队/推广员业绩</a>
<!-- <a href="{:U('Query/promoteQuota')}" class="<?=is_active_class(['Query'], ['promoteQuota', 'quotaDtl'])?>">推广员指标</a> -->
<a href="{:U('Query/iosDownLoadData')}" class="<?=is_active_class(['Query'], ['iosDownLoadData'])?>">IOS下载数统计</a>
<a href="{:U('Query/userretention')}" class="<?=is_active_class(['Query'], ['userretention'])?>">用户留存率</a>
<a href="{:U('Query/gameData')}" class="<?=is_active_class(['Query'], ['gameData'])?>">游戏分区数据汇总</a>
</div>
<?php endif;?>
<?php if ($canViewUserRecharge && $loginer['level'] == 1) :?>
<div class="subNav jssubNav"><i class="prev_icon icon_caiwu"></i><span>财务管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('Finance/index')}" class="<if condition='CONTROLLER_NAME eq Finance and ACTION_NAME eq index '>active</if> ">结算中心</a>
<a href="{:U('Finance/settlementDtl')}" class="<if condition='CONTROLLER_NAME eq Finance and ACTION_NAME eq settlementDtl '>active</if> ">结算明细</a>
<a href="{:U('Finance/withdrawRecord')}" class="<if condition='CONTROLLER_NAME eq Finance and (ACTION_NAME eq withdrawRecord or ACTION_NAME eq withdrawDtl or ACTION_NAME eq settlementOrder) '>active</if> ">提现记录</a>
<?php if ($loginer['withdraw_show'] == 1) :?>
<a href="{:U('Withdraw/index')}" class="<if condition='CONTROLLER_NAME eq Withdraw and (ACTION_NAME eq index or ACTION_NAME eq withdrawDetail or ACTION_NAME eq withdrawOrderDetail) '>active</if> ">公司结算</a>
<?php endif;?>
</div>
<a href="{:U('Finance/index')}" class="<?=is_active_class(['Finance'], ['index'])?>">结算中心</a>
<a href="{:U('Finance/settlementDtl')}" class="<?=is_active_class(['Finance'], ['settlementDtl'])?>">结算明细</a>
<a href="{:U('Finance/withdrawRecord')}" class="<?=is_active_class(['Finance'], ['withdrawRecord', 'withdrawDtl', 'settlementOrder'])?>">提现记录</a>
<?php if ($loginer['withdraw_show'] == 1) :?>
<a href="{:U('Withdraw/index')}" class="<?=is_active_class(['Withdraw'], ['index', 'withdrawDetail', 'withdrawOrderDetail'])?>">公司结算</a>
<?php endif;?>
</div>
<?php endif ;?>
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>游戏管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('Game/index')}" class="<if condition='CONTROLLER_NAME eq Game and (ACTION_NAME eq index) '>active</if> ">专服管理</a>
<a href="{:U('Game/index')}" class="<?=is_active_class(['Game'], ['index'])?>">专服管理</a>
<?php if($isOpenQuery):?>
<a href="{:U('Game/mix')}" class="<if condition='CONTROLLER_NAME eq Game and (ACTION_NAME eq mix) '>active</if> ">混服管理</a>
<a href="{:U('Game/mix')}" class="<?=is_active_class(['Game'], ['mix'])?>">混服管理</a>
<if condition="getParentPromoteId(PID) eq 0">
<a href="{:U('GameDivide/index')}" class="<if condition='CONTROLLER_NAME eq GameDivide and (ACTION_NAME eq index ) '>active</if> ">分成比例</a>
<a href="{:U('Promote/setChildGamePermission')}" class="<if condition='CONTROLLER_NAME eq Promote and (ACTION_NAME eq setChildGamePermission ) '>active</if> ">设置</a>
<a href="{:U('GameDivide/index')}" class="<?=is_active_class(['GameDivide'], ['index'])?>">分成比例</a>
<a href="{:U('Promote/setChildGamePermission')}" class="<?=is_active_class(['Promote'], ['setChildGamePermission'])?>">设置</a>
</if>
<a href="{:U('Apply/feature')}" class="<if condition='CONTROLLER_NAME eq Apply and (ACTION_NAME eq feature or ACTION_NAME eq my_game or ACTION_NAME eq my_game_ch or ACTION_NAME eq child_game ) '>active</if> ">资料专区</a>
<a href="{:U('Apply/feature')}" class="<?=is_active_class(['Apply'], ['feature'])?>">资料专区</a>
<?php endif;?>
</div>
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>安全管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<!-- <a href="{:U('Apply/app_index')}" class="<if condition='CONTROLLER_NAME eq Apply and ACTION_NAME eq app_index '>active</if> ">APP列表</a>-->
<a href="{:U('Safe/bindTel')}" class="<if condition='CONTROLLER_NAME eq Safe and (ACTION_NAME eq bindTel or ACTION_NAME eq bindTel or ACTION_NAME eq bindTel or ACTION_NAME eq bindTel ) '>active</if> ">短信登陆设置</a>
<a href="{:U('Download/listsIndex')}" class="<if condition='CONTROLLER_NAME eq Download and (ACTION_NAME eq listsIndex or ACTION_NAME eq listsIndex or ACTION_NAME eq my_game_ch or ACTION_NAME eq child_game ) '>active</if> ">下载日志管理</a>
<a href="{:U('Safe/modifyloginpassword')}" class="<if condition='CONTROLLER_NAME eq Safe and (ACTION_NAME eq modifyloginpassword or ACTION_NAME eq my_game or ACTION_NAME eq my_game_ch or ACTION_NAME eq child_game ) '>active</if> ">修改登录密码</a>
<a href="{:U('Safe/setSafeIndex')}" class="<if condition='CONTROLLER_NAME eq Safe and (ACTION_NAME eq setSafeIndex or ACTION_NAME eq my_game or ACTION_NAME eq my_game_ch or ACTION_NAME eq child_game ) '>active</if> ">设置安全密码</a>
<!--<a href="{:U('Apply/app_index')}" class="<?=is_active_class(['Apply'], ['app_index'])?>">APP列表</a>-->
<a href="{:U('Safe/bindTel')}" class="<?=is_active_class(['Safe'], ['bindTel'])?>">短信登陆设置</a>
<a href="{:U('Download/listsIndex')}" class="<?=is_active_class(['Download'], ['listsIndex'])?>">下载日志管理</a>
<a href="{:U('Safe/modifyloginpassword')}" class="<?=is_active_class(['Safe'], ['modifyloginpassword'])?>">修改登录密码</a>
<a href="{:U('Safe/setSafeIndex')}" class="<?=is_active_class(['Safe'], ['setSafeIndex'])?>">设置安全密码</a>
<?php if ($loginer['level'] == 1) :?>
<a href="{:U('Safe/modifyBaseInfo')}" class="<if condition='CONTROLLER_NAME eq Safe and (ACTION_NAME eq modifyBaseInfo or ACTION_NAME eq my_game or ACTION_NAME eq my_game_ch or ACTION_NAME eq child_game ) '>active</if> ">用户基本信息</a>
<a href="{:U('Safe/modifyBaseInfo')}" class="<?=is_active_class(['Safe'], ['modifyBaseInfo'])?>">用户基本信息</a>
<?php endif;?>
<a href="{:U('Safe/promoteLogs')}" class="<if condition='CONTROLLER_NAME eq Safe and (ACTION_NAME eq promoteLogs or ACTION_NAME eq promoteLogs or ACTION_NAME eq promoteLogs or ACTION_NAME eq promoteLogs ) '>active</if> ">操作日志</a>
<a href="{:U('Safe/promoteLogs')}" class="<?=is_active_class(['Safe'], ['promoteLogs'])?>">操作日志</a>
</div>
<?php if($loginer['level'] <= 2):?>
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>测试资源</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('TestingResource/index')}" class="<if condition='CONTROLLER_NAME eq TestingResource and ACTION_NAME eq index '>active</if> ">测试资源申请</a>
<a href="{:U('TestingResource/batches')}" class="<if condition='CONTROLLER_NAME eq TestingResource and ACTION_NAME eq batches '>active</if> ">测试资源申请记录</a>
<a href="{:U('TestingResource/index')}" class="<?=is_active_class(['TestingResource'], ['index'])?>">测试资源申请</a>
<a href="{:U('TestingResource/batches')}" class="<?=is_active_class(['TestingResource'], ['batches'])?>">测试资源申请记录</a>
</div>
<?php endif;?>
<?php if(C('APP_ENV') == 'dev' || in_array($loginer['company_id'], [334, 370])):?>
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>评级管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<?php if($loginer['level'] <= 2):?>
<a href="{:U('PromoteGrade/settings')}" class="<if condition='CONTROLLER_NAME eq PromoteGrade and (ACTION_NAME eq settings or ACTION_NAME eq setting) '>active</if> ">评级设定</a>
<a href="{:U('PromoteGrade/settings')}" class="<?=is_active_class(['PromoteGrade'], ['settings', 'setting'])?>">评级设定</a>
<?php endif;?>
<a href="{:U('PromoteGrade/index')}" class="<if condition='CONTROLLER_NAME eq PromoteGrade and ACTION_NAME eq index '>active</if> ">团队评级</a>
<a href="{:U('PromoteGrade/index')}" class="<?=is_active_class(['PromoteGrade'], ['index'])?>">团队评级</a>
</div>
<?php endif;?>
<!--<eq name="parent_id" value="0">
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>扶持管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('Support/index')}" class="<if condition='CONTROLLER_NAME eq Support and (ACTION_NAME eq index or ACTION_NAME eq add or ACTION_NAME eq apply ) '>active</if> ">扶持申请</a>
<a href="{:U('Support/lists')}" class="<if condition='CONTROLLER_NAME eq Support and ACTION_NAME eq lists '>active</if> ">扶持记录</a>
<a href="{:U('Support/quota')}" class="<if condition='CONTROLLER_NAME eq Support and ACTION_NAME eq quota '>active</if> ">扶持额度</a>
</div>
</eq>-->
<!-- <eq name="parent_id" value="0">
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>扶持管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('Support/index')}" class="<?=is_active_class(['Support'], ['add', 'apply'])?>">扶持申请</a>
<a href="{:U('Support/lists')}" class="<?=is_active_class(['Support'], ['lists'])?>">扶持记录</a>
<a href="{:U('Support/quota')}" class="<?=is_active_class(['Support'], ['quota'])?>">扶持额度</a>
</div>
</eq> -->
<!--<div class="subNav jssubNav"><i class="prev_icon icon_fuli"></i><span>会长福利</span><i class="arrow_icon"></i></div>-->
<div class="subNav jssubNav"><i class="prev_icon icon_fuli"></i><span>平台币管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('PromoteCoin/myCoin')}" class="<if condition='CONTROLLER_NAME eq PromoteCoin and (ACTION_NAME eq myCoin or ACTION_NAME eq coinRecord or ACTION_NAME eq coinRecordDesc) '>active</if> ">我的平台币</a>
<a href="{:U('PromoteCoin/transferLogs')}" class="<if condition='CONTROLLER_NAME eq PromoteCoin and (ACTION_NAME eq shift or ACTION_NAME eq transferLogs) '>active</if> ">平台币转移</a>
<a href="{:U('PromoteCoin/myCoin')}" class="<?=is_active_class(['PromoteCoin'], ['myCoin', 'coinRecord', 'coinRecordDesc'])?>">我的平台币</a>
<a href="{:U('PromoteCoin/transferLogs')}" class="<?=is_active_class(['PromoteCoin'], ['shift', 'transferLogs'])?>">平台币转移</a>
<?php if($loginer['level'] == 1):?>
<a href="{:U('CoinOrder/order_list')}" class="<if condition='CONTROLLER_NAME eq CoinOrder and (ACTION_NAME eq order_list or ACTION_NAME eq order_add or ACTION_NAME eq order_detail) '>active</if> ">平台币充值</a>
<a href="{:U('CoinOrder/order_list')}" class="<?=is_active_class(['CoinOrder'], ['order_list', 'order_add', 'order_detail'])?>">平台币充值</a>
<?php endif;?>
</div>
<?php if($canViewUserRecharge):?>
<div class="subNav jssubNav"><i class="prev_icon icon_fuli"></i><span>玩家管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('Players/playAction')}" class="<if condition='CONTROLLER_NAME eq Players and (ACTION_NAME eq playAction)'>active</if> ">行为日志</a>
<a href="{:U('Players/playAction')}" class="<?=is_active_class(['Players'], ['playAction'])?>">行为日志</a>
</div>
<?php endif;?>
</div>

@ -174,14 +174,14 @@
<tr class="num2">
<td>{$vo.game_name}</td>
<td>{:getSDKTypeName($vo['sdk_version'],true)}</td>
<td>{$vo.role_num}</td>
<td>{$vo.user_num}</td>
<td>{$vo.new_user_num}|{$vo.new_device_num}</td>
<td>{$vo.new_ip_num}</td>
<td>{$vo.login_user_num}</td>
<td><?=intval($vo['role_num'])?></td>
<td><?=intval($vo['user_num'])?></td>
<td><?=intval($vo['new_user_num']).'|'.intval($vo['new_device_num'])?></td>
<td><?=intval($vo['new_ip_num'])?></td>
<td><?=intval($vo['login_user_num'])?></td>
<?php if ($canViewUserRecharge) :?>
<td>{$vo.spend_user_num}</td>
<td>{$vo.spend_num}</td>
<td><?=intval($vo['spend_user_num'])?></td>
<td><?=intval($vo['spend_num'])?></td>
<td>{$vo.spend_all_amount|default=0}</td>
<td class="spend-element th-hide">{$vo.spend_cash|default=0}</td>
<td class="spend-element th-hide">{$vo.spend_generic|default=0}</td>

Loading…
Cancel
Save