master
yulingwei 5 years ago
commit 4071341458

@ -212,9 +212,11 @@ class MemberController extends ThinkController
->group('tab_user.id')
->where($hav)
->having($havs)->select(false);
$allcountsql = str_replace("tab_user.promote_id","ss.promote_id",$sql);
//获取总额
$allcount = M()->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $sql . ') as a')->select();
$this->assign('history_count', $allcount[0]['recharge_total']);
$allcount = M()->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $allcountsql . ') as a')->select();
$this->assign('history_count', $allcount[0]['recharge_total']?:0);
//替换为新表
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
@ -227,9 +229,10 @@ class MemberController extends ThinkController
}
$jcount = M('User', 'tab_')->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $sql . ') as a')->select();
$count = $jcount[0]['count'];
//var_dump($jcount);die();
$this->assign('now_count', $jcount[0]['recharge_total']);
$count = $jcount[0]['count'] ?:0 ;
$this->assign('user_count', $count);
// var_dump($jcount);die();
$this->assign('now_count', $jcount[0]['recharge_total']?:0);
$model = M('Model')->getByName('user');

@ -48,7 +48,7 @@ class RechargeSumController extends ThinkController
}
//当天注册人数
$registerNum = D('User')->where(array_merge($rmap, array('puid' => 0)))->join("tab_user_play on tab_user.id = tab_user_play.user_id and tab_user.fgame_id = tab_user_play.game_id")->field("tab_user.id")->select();
$registerNum = D('User')->where(array_merge($rmap, array('puid' => 0)))->join("tab_user_play on tab_user.id = tab_user_play.user_id and tab_user.fgame_id = tab_user_play.game_id", 'left')->field("tab_user.id")->select();
$registerNum = $registerNum ? array_column($registerNum, 'id') : [];
//当天活跃人数

@ -100,7 +100,6 @@ class SpendController extends ThinkController
$map = '1 = 2';
$map1 = $map;
}
echo (D(self::model_name)->where($map1)->fetchSql(true)->sum('pay_amount'));
$total = null_to_0(D(self::model_name)->where($map1)->sum('pay_amount'));
$ttotal = null_to_0(D(self::model_name)->where('pay_time' . total(1))->where(array('pay_status' => 1))->sum('pay_amount'));
$ytotal = null_to_0(D(self::model_name)->where('pay_time' . total(5))->where(array('pay_status' => 1))->sum('pay_amount'));

@ -339,6 +339,15 @@ class ToolController extends ThinkController {
$data[$name] = $config;
$configs=array_merge($configs,$data);
$result = file_put_contents($config_file, "<?php\treturn " . var_export($configs, true) . ";");
$ageConfigJson = json_encode($config);
M('tool', 'tab_')->where([
'name' => $name
])->save([
'config' => $ageConfigJson,
'type' => 1,
'status' => isset($config['status']) ? $config['status'] : $config['bat']
]);
}
public function ios_game(){

@ -224,8 +224,8 @@
<th>注册方式</th>
</if>
<th >注册时间</th>
<th >注册IP</th>
<th >最后登录时间</th>
<th >最后登录IP</th>
<th >设备号</th>
<th >账号状态</th>
<th >拉黑状态</th>
@ -276,6 +276,7 @@
</if>
<td >{$data.register_time|date='Y-m-d H:i:s',###}</td>
<td >{$data.register_ip}</td>
<td >
<if condition="$data.login_time eq null">
@ -283,7 +284,6 @@
<span class="login_old">{$data['login_time']|date='Y-m-d H:i:s',###}</span>
</if>
</td>
<td >{$data.register_ip}</td>
<td >{$data.device_number}</td>
<if condition="get_info_status($data['lock_status'],4) eq 锁定">
@ -310,7 +310,8 @@
<if condition="I('promote_id') && I('promote_id') gt 0 ">
<td colspan="8">
当前用户累计充值:{$now_count} &#12288;&#12288;
历史累计充值:{$history_count}
历史累计充值:{$history_count}&#12288;&#12288;
用户数:{$user_count}
</td>
<td colspan="8" style="font-style: 12px;color: #a9a9a9;text-align: center;">
当前用户累计充值:&#12288;当前属于该推广员的用户的充值累计(不含用户换绑前记录)&#12288;&#12288;/&#12288;&#12288;
@ -318,7 +319,7 @@
</td>
<else />
<td colspan="99">
当前用户累计充值:{$now_count}
当前用户累计充值:{$now_count}&#12288;&#12288;用户数:{$user_count}
</td>
</if>

@ -1420,7 +1420,9 @@ class DownloadController extends BaseController {
'basicPromotes' => json_encode($basicPromotes,FALSE),
];
$map['promotes'] = json_encode($data,FALSE);
$map['ids'] = $ids;
$map['parentsinfo'] = json_encode($parent,FALSE);;
$map['currentDisplay'] = $currentDisplay;
$map['ids'] = $ids;
if ($gameId > 0) {
$params['game_id'] = $gameId;
}
@ -1812,7 +1814,7 @@ class DownloadController extends BaseController {
array('create_time','创建时间'),
);
$model = M('user_play_info','tab_');
$data = $model->field('user_account,promote_account,game_name,server_name,role_name,role_level')->where($map)->order('create_time desc')->select();
$data = $model->field('user_account,promote_account,game_name,server_name,role_name,role_level,create_time')->where($map)->order('create_time desc')->select();
$xlsData = [];
foreach ($data as $key1 => $value1) {
$value1['user_account'] = $this->encryption($value1['user_account']);
@ -1873,7 +1875,7 @@ class DownloadController extends BaseController {
->join($serverJoin)//关联区服表
->where($map)
->group('tab_apply.game_id')
->order('g.sort desc,tab_apply.id desc')
->order('g.sort desc,g.id desc')
->select();
$records = [];
if (!empty($data)) {
@ -2693,6 +2695,15 @@ class DownloadController extends BaseController {
if(!empty($map['lock_status'])) {
$params['lock_status'] = $map["lock_status"];
}
if(!empty($map['parentsinfo'])) {
$parent = json_decode($map['parentsinfo'],TRUE);
unset($map['parentsinfo']);
}
if(!empty($map['currentDisplay'])) {
$currentDisplay = $map['currentDisplay'];
unset($map['currentDisplay']);
}
$params['begin_time'] = $map['begin_time'];
$params['end_time'] = $map['end_time'];
@ -2707,6 +2718,39 @@ class DownloadController extends BaseController {
$rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params);
$rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params);
$records = [];
if (I('p', 1) == 1) {
$selfParams = $params;
$selfParams['isContainSubs'] = false;
$selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$parent['id']], $selfParams);
$selfCreateRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds([$parent['id']], $selfParams);
$selfNewCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds([$parent['id']], $selfParams);
// $selfNewCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds([$parent['id']], $selfParams);
$selfNewCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds([$parent['id']], $selfParams);
$selfLoginUserCountList = $promoteRepository->getLoginUserCountByIds([$parent['id']], $selfParams);
$selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams);
$selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams);
$selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams);
$records[] = [
'id' => $parent['id'],
'account' => $parent['account'],
'real_name' => $parent['real_name'],
'level' => $parent['level'],
'create_role_count' => $selfCreateRoleCountList[$parent['id']],
'create_role_user_count' => $selfCreateRoleUserCountList[$parent['id']],
'new_create_role_user_count' => $selfNewCreateRoleUserCountList[$parent['id']],
// 'new_create_role_device_count' => $selfNewCreateRoleDeviceCountList[$parent['id']],
'new_create_role_ip_count' => $selfNewCreateRoleIpCountList[$parent['id']],
'login_user_count' => $selfLoginUserCountList[$parent['id']],
'recharge_count' => $selfRechargeCountList[$parent['id']],
'recharge_user_count' => $selfRechargeUserCountList[$parent['id']],
'recharge_amount' => $selfRechargeAmountList[$parent['id']]['ban_coin'] + $selfRechargeAmountList[$parent['id']]['coin'] + $selfRechargeAmountList[$parent['id']]['cash'],
'recharge_by_ban_coin' => $selfRechargeAmountList[$parent['id']]['ban_coin'],
'recharge_by_coin' => $selfRechargeAmountList[$parent['id']]['coin'],
'recharge_by_cash' => $selfRechargeAmountList[$parent['id']]['cash'],
'current_display' => $currentDisplay,
];
}
foreach ($promotes as $promote) {
$id = $promote['id'];
$records[] = [
@ -2769,7 +2813,9 @@ class DownloadController extends BaseController {
$subMap['create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]];
$roleIdMap = $subMap;
$roleIds = M('user_play_data_count', 'tab_')->where($roleIdMap)->group('role_id')->getField('role_id', true);
$map['role_id'] = ['in', $roleIds];
if (count($roleIds) > 0) {
$map['role_id'] = ['in', $roleIds];
}
if ($costBegin != '' || $costEnd != '') {
$having = '';
if ($costBegin != '' && $costEnd != '') {

@ -1772,7 +1772,9 @@ class QueryController extends BaseController
$subMap['create_time'] = ['between', [$begTime, $endTime - 1]];
$roleIdMap = $subMap;
$roleIds = M('user_play_data_count', 'tab_')->where($roleIdMap)->group('role_id')->getField('role_id', true);
$map['role_id'] = ['in', $roleIds];
if (count($roleIds) > 0) {
$map['role_id'] = ['in', $roleIds];
}
if ($costBegin != '' || $costEnd != '') {
$having = '';
if ($costBegin != '' && $costEnd != '') {

@ -159,22 +159,22 @@
<if condition="I('game_id', 0) gt 0">
<th>游戏名称</th>
<else/>
<th>付费游戏数</th>
<th title="当日有产生付费的游戏(区分 Android与ios)">付费游戏数</th>
</if>
<if condition="I('promote_id', 0) gt 0 or I('sub_promote_id', 0) gt 0">
<th>所属渠道</th>
</if>
<th>活跃用户</th>
<th>新增用户</th>
<th>付费用户</th>
<th>新增付费用户</th>
<th>付费总额</th>
<th>付费率</th>
<th>新增付费额</th>
<th>累计付费用户</th>
<th title="当日在线的推广玩家">活跃用户</th>
<th title="当日新注册用户付费用户:当日游戏充值用户">新增用户</th>
<th title="当日游戏充值用户">付费用户</th>
<th title="注册以来首次充值的用户">新增付费用户</th>
<th title="当日充值总额">付费总额</th>
<th title="单日在线玩家充值率">付费率</th>
<th title="新增注册用户充值总额">新增付费额</th>
<th title="历史累计付费注册用户(去重)">累计付费用户</th>
<!-- <th>1日留存</th> -->
<th>ARPU</th>
<th>ARPPU</th>
<th title="即每个用户平均收入">ARPU</th>
<th title="每付费用户平均收益">ARPPU</th>
<if condition="I('game_id', 0) eq 0">
<th>详情</th>
</if>

Loading…
Cancel
Save