解决冲突

master
ELF 5 years ago
commit 06bfdbca93

4
.gitignore vendored

@ -3,4 +3,6 @@ Runtime/
Uploads/
Application/Common/Conf/env.php
Application/Common/Conf/pay_config.php
.idea/
Application/Sdk/OrderNo/
.idea/
Uploads/

@ -0,0 +1,355 @@
<?php
namespace Base\Repository;
class PromoteRepository {
public function __construct()
{
}
private function assembleZero($allKeys, $records, $zeroValue) {
$noExistKeys = array_diff($allKeys, array_keys($records));
foreach ($noExistKeys as $key) {
$records[$key] = $zeroValue;
}
return $records;
}
/**
* 获取业绩公共map
*/
private function getPublicAchievementMap($ids, $params)
{
$isContainSubs = false;
if (isset($params['isContainSubs']) && $params['isContainSubs']) {
$isContainSubs = true;
}
$map = [];
$map['promote_id'] = ['in', $ids];
if ($isContainSubs) {
$map['promote_id'] = ['in', array_merge($ids, array_keys($params['basicPromotes']))];
}
if (isset($params['game_id'])) {
$map['game_id'] = $params['game_id'];
}
if (isset($params['server_id'])) {
$map['server_id'] = $params['server_id'];
}
if (isset($params['sdk_version'])) {
$map['sdk_version'] = $params['sdk_version'];
}
if (isset($params['begin_time']) && isset($params['begin_time'])) {
$map['create_time'] = ['between', [$params['begin_time'], $params['end_time']]];
}
return $map;
}
/**
* 获取指定推广员底下的角色创建数
*/
public function getCreateRoleCountByIds(array $ids, array $params = [])
{
if (count($ids) == 0) {
return [];
}
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('user_play_info', 'tab_')->field(['count(*) count', 'promote_id'])->where($map)->group('promote_id')->select();
$records = [];
foreach ($items as $item) {
$promoteId = $item['promote_id'];
if (isset($params['basicPromotes'][$item['promote_id']])) {
$promoteId = $params['basicPromotes'][$item['promote_id']];
}
if (isset($records[$promoteId])) {
$records[$promoteId] += $item['count'];
} else {
$records[$promoteId] = $item['count'];
}
}
$records = $this->assembleZero($ids, $records, 0);
return $records;
}
/**
* 获取指定推广员底下的角色创建的用户数
*/
public function getCreateRoleUserCountByIds(array $ids, array $params = [])
{
if (count($ids) == 0) {
return [];
}
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('user_play_info', 'tab_')->field(['count(distinct user_id) count', 'promote_id'])->where($map)->group('promote_id')->select();
$records = [];
foreach ($items as $item) {
$promoteId = $item['promote_id'];
if (isset($params['basicPromotes'][$item['promote_id']])) {
$promoteId = $params['basicPromotes'][$item['promote_id']];
}
if (isset($records[$promoteId])) {
$records[$promoteId] += $item['count'];
} else {
$records[$promoteId] = $item['count'];
}
}
$records = $this->assembleZero($ids, $records, 0);
return $records;
}
/**
* 获取指定推广员底下的新创角设备数
*/
public function getNewCreateRoleDeviceCountByIds(array $ids, array $params = [])
{
if (count($ids) == 0) {
return [];
}
$map = $this->getPublicAchievementMap($ids, $params);
$subMap = $map;
if (isset($params['begin_time']) && isset($params['begin_time'])) {
$subMap['create_time'] = ['lt', $params['begin_time']];
}
$subQuery = M('user_play_info', 'tab_')->field('create_device_number')->group('create_device_number')->where($subMap)->buildSql();
$map['create_device_number'] = ['exp', ' not in (' . $subQuery . ')'];
$inQuery = M('user_play_info', 'tab_')->field('create_device_number')->group('create_device_number')->where($map)->buildSql();
$resultMap = ['create_device_number' => ['exp', ' in (' . $inQuery . ')']];
$items = M('user_play_info', 'tab_')->field(['count(*) count', 'promote_id'])->where($resultMap)->group('promote_id')->select();
$records = [];
foreach ($items as $item) {
$promoteId = $item['promote_id'];
if (isset($params['basicPromotes'][$item['promote_id']])) {
$promoteId = $params['basicPromotes'][$item['promote_id']];
}
if (isset($records[$promoteId])) {
$records[$promoteId] += $item['count'];
} else {
$records[$promoteId] = $item['count'];
}
}
$records = $this->assembleZero($ids, [], 0);
return $records;
}
/**
* 获取指定推广员底下的新创角IP数
*/
public function getNewCreateRoleIpCountByIds(array $ids, array $params = [])
{
if (count($ids) == 0) {
return [];
}
$map = $this->getPublicAchievementMap($ids, $params);
$subMap = $map;
if (isset($params['begin_time']) && isset($params['begin_time'])) {
$subMap['create_time'] = ['lt', $params['begin_time']];
}
$subQuery = M('user_play_info', 'tab_')->field('create_ip')->group('create_ip')->where($subMap)->buildSql();
$map['create_ip'] = ['exp', ' not in (' . $subQuery . ')'];
$inQuery = M('user_play_info', 'tab_')->field('create_ip')->group('create_ip')->where($map)->buildSql();
$resultMap = ['create_ip' => ['exp', ' in (' . $inQuery . ')']];
$items = M('user_play_info', 'tab_')->field(['count(*) count', 'promote_id'])->where($resultMap)->group('promote_id')->select();
$records = [];
foreach ($items as $item) {
$promoteId = $item['promote_id'];
if (isset($params['basicPromotes'][$item['promote_id']])) {
$promoteId = $params['basicPromotes'][$item['promote_id']];
}
if (isset($records[$promoteId])) {
$records[$promoteId] += $item['count'];
} else {
$records[$promoteId] = $item['count'];
}
}
$records = $this->assembleZero($ids, [], 0);
return $records;
}
/**
* 获取指定推广员底下的新创角用户数
*/
public function getNewCreateRoleUserCountByIds(array $ids, array $params = [])
{
if (count($ids) == 0) {
return [];
}
$map = $this->getPublicAchievementMap($ids, $params);
$subMap = $map;
if (isset($params['begin_time']) && isset($params['begin_time'])) {
$subMap['create_time'] = ['lt', $params['begin_time']];
}
$subQuery = M('user_play_info', 'tab_')->field('user_id')->group('user_id')->where($subMap)->buildSql();
$map['user_id'] = ['exp', ' not in (' . $subQuery . ')'];
$inQuery = M('user_play_info', 'tab_')->field('user_id')->group('user_id')->where($map)->buildSql();
$resultMap = ['user_id' => ['exp', ' in (' . $inQuery . ')']];
$items = M('user_play_info', 'tab_')->field(['count(*) count', 'promote_id'])->where($resultMap)->group('promote_id')->select();
$records = [];
foreach ($items as $item) {
$promoteId = $item['promote_id'];
if (isset($params['basicPromotes'][$item['promote_id']])) {
$promoteId = $params['basicPromotes'][$item['promote_id']];
}
if (isset($records[$promoteId])) {
$records[$promoteId] += $item['count'];
} else {
$records[$promoteId] = $item['count'];
}
}
$records = $this->assembleZero($ids, [], 0);
return $records;
}
/**
* 获取指定推广员底下的登录用户数
*/
public function getLoginUserCountByIds(array $ids, array $params = [])
{
if (count($ids) == 0) {
return [];
}
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('user', 'tab_')->field(['count(*) count', 'promote_id'])->where($map)->group('promote_id')->select();
$records = [];
foreach ($items as $item) {
$promoteId = $item['promote_id'];
if (isset($params['basicPromotes'][$item['promote_id']])) {
$promoteId = $params['basicPromotes'][$item['promote_id']];
}
if (isset($records[$promoteId])) {
$records[$promoteId] += $item['count'];
} else {
$records[$promoteId] = $item['count'];
}
}
$records = $this->assembleZero($ids, $records, 0);
return $records;
}
/**
* 获取指定推广员底下的充值次数
*/
public function getRechargeCountByIds(array $ids, array $params = [])
{
if (count($ids) == 0) {
return [];
}
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('spend', 'tab_')->field(['count(*) count', 'promote_id'])->where($map)->group('promote_id')->select();
$records = [];
foreach ($items as $item) {
$promoteId = $item['promote_id'];
if (isset($params['basicPromotes'][$item['promote_id']])) {
$promoteId = $params['basicPromotes'][$item['promote_id']];
}
if (isset($records[$promoteId])) {
$records[$promoteId] += $item['count'];
} else {
$records[$promoteId] = $item['count'];
}
}
$records = $this->assembleZero($ids, $records, 0);
return $records;
}
/**
* 获取指定推广员底下的充值用户数
*/
public function getRechargeUserCountByIds(array $ids, array $params = [])
{
if (count($ids) == 0) {
return [];
}
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('spend', 'tab_')->field(['count(distinct user_id) count', 'promote_id'])->where($map)->group('promote_id')->select();
$records = [];
foreach ($items as $item) {
$promoteId = $item['promote_id'];
if (isset($params['basicPromotes'][$item['promote_id']])) {
$promoteId = $params['basicPromotes'][$item['promote_id']];
}
if (isset($records[$promoteId])) {
$records[$promoteId] += $item['count'];
} else {
$records[$promoteId] = $item['count'];
}
}
$records = $this->assembleZero($ids, $records, 0);
return $records;
}
/**
* 获取指定推广员底下的充值金额(分类型)
*/
public function getRechargeAmountByIds(array $ids, array $params = [])
{
if (count($ids) == 0) {
return [];
}
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('spend', 'tab_')->field(['sum(pay_amount) amount', 'promote_id', 'pay_way'])->where($map)->group('promote_id, pay_way')->select();
$records = [];
foreach ($items as $item) {
if ($item['pay_way'] == -1) {
$records[$item['promote_id']]['ban_coin'] = $item['amount'];
} elseif ($item['pay_way'] == 0) {
$records[$item['promote_id']]['coin'] = $item['amount'];
} else {
if (isset($records[$item['promote_id']])) {
$records[$item['promote_id']]['cash'] = isset($records[$item['promote_id']]['cash']) ?
$records[$item['promote_id']]['cash'] + $item['amount'] :
$item['amount'];
} else {
$records[$item['promote_id']]['cash'] = $item['amount'];
}
}
}
foreach ($ids as $id) {
if (isset($records[$id])) {
$records[$id] = [
'ban_coin' => isset($records[$id]['ban_coin']) ? $records[$id]['ban_coin'] : 0,
'coin' => isset($records[$id]['coin']) ? $records[$id]['coin'] : 0,
'cash' => isset($records[$id]['cash']) ? $records[$id]['cash'] : 0,
];
} else {
$records[$id] = [
'ban_coin' => 0,
'coin' => 0,
'cash' => 0,
];
}
}
return $records;
}
}

@ -0,0 +1,198 @@
<?php
namespace Base\Repository;
class SpendRepository {
public function __construct()
{
}
private function assembleDayRecords($items, $dayList, $valueColumn, $dayColumn = 'day')
{
$records = [];
foreach ($dayList as $day) {
$dayValue = 0;
foreach ($items as $item) {
if ($item[$dayColumn] == $day) {
$dayValue = $item[$valueColumn];
}
}
$records[$day] = $dayValue;
}
return $records;
}
/**
* 付费游戏数
*/
public function getPayGameCountByDay($params) {
$beginTime = $params['begin_time'] ?? 0;
$endTime = $params['end_time'] ?? 0;
$gameId = $params['game_id'] ?? 0;
$serverId = $params['server_id'] ?? 0;
$ids = $params['promote_id'] ?? [];
$isBan = $params['is_ban'] ?? false;
$dayList = $params['dayList'] ?? [];
$map = [];
$map['pay_status'] = 1;
$map['promote_id'] = ['in', $ids];
$map['pay_time'] = ['between', [$beginTime, $endTime]];
$map['game_id'] = $gameId > 0 ? $gameId : ['gt', 0];
$map['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1'];
$field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day, count(DISTINCT game_id) count';
$items = M('spend', 'tab_')->field($field)->where($map)->group('day')->select();
return $this->assembleDayRecords($items, $dayList, 'count');
}
/**
* 按天统计付款总额
*/
public function getPayAmountByDay($params) {
$beginTime = $params['begin_time'] ?? 0;
$endTime = $params['end_time'] ?? 0;
$gameId = $params['game_id'] ?? 0;
$serverId = $params['server_id'] ?? 0;
$ids = $params['promote_id'] ?? [];
$isBan = $params['is_ban'] ?? false;
$dayList = $params['dayList'] ?? [];
$map['pay_status'] = 1;
$map['pay_time'] = ['between', [$beginTime, $endTime]];
$map['game_id'] = $gameId > 0 ? $gameId : ['gt', 0];
$map['promote_id'] = ['in', $ids];
$map['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1'];
$field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day,sum(pay_amount) as amount';
$items = M('spend', 'tab_')->field($field)->where($map)->group('FROM_UNIXTIME(day, "%Y-%m-%d")')->select();
return $this->assembleDayRecords($items, $dayList, 'amount');
}
/**
* 按天统计付款用户数
*/
public function getPayUserCountByDay($params) {
$beginTime = $params['begin_time'] ?? 0;
$endTime = $params['end_time'] ?? 0;
$gameId = $params['game_id'] ?? 0;
$serverId = $params['server_id'] ?? 0;
$ids = $params['promote_id'] ?? [];
$isBan = $params['is_ban'] ?? false;
$dayList = $params['dayList'] ?? [];
$map['pay_status'] = 1;
$map['pay_time'] = ['between', [$beginTime, $endTime]];
$map['game_id'] = $gameId > 0 ? $gameId : ['gt', 0];
$map['promote_id'] = ['in', $ids];
$map['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1'];
$field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day, count(distinct user_id) count';
$items = M('spend', 'tab_')->field($field)->where($map)->group('day')->select();
return $this->assembleDayRecords($items, $dayList, 'count');
}
/**
* 按照时间分组统计新增付费用户数
*/
public function getNewPayUserCountByDay($params) {
$dayList = $params['dayList'] ?? [];
$gameId = $params['game_id'] ?? 0;
$serverId = $params['server_id'] ?? 0;
$ids = $params['promote_id'] ?? [];
$isBan = $params['is_ban'] ?? false;
$map = [];
$map['pay_status']=1;
if ($gameId > 0) {
$map['game_id'] = $gameId;
}
if ($serverId > 0) {
$map['server_id'] = $serverId;
}
$map['promote_id'] = ['in', $ids];
$map['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1'];
$oldMap = $map;
$records = [];
foreach ($dayList as $day) {
$time = strtotime($day);
$oldMap['pay_time'] = ['lt', $time];
$map['pay_time'] = ['between', [$time, ($time + 24 * 3600 -1)]];
$oldQuery = M('spend', 'tab_')->field('user_id')->where($oldMap)->group('user_id')->buildSql();
$map['user_id'] = ['exp', ' not in (' . $oldQuery . ')'];
$result = M('spend', 'tab_')->field('count(distinct user_id) count')->where($map)->find();
$records[$day] = $result['count'];
}
return $records;
}
/**
* 按照时间分组统计新增付费用户付费金额
*/
public function getNewPayAmountByDay($params) {
$dayList = $params['dayList'] ?? [];
$gameId = $params['game_id'] ?? 0;
$serverId = $params['server_id'] ?? 0;
$ids = $params['promote_id'] ?? [];
$isBan = $params['is_ban'] ?? false;
$map = [];
$map['pay_status']=1;
if ($gameId > 0) {
$map['game_id'] = $gameId;
}
if ($serverId > 0) {
$map['server_id'] = $serverId;
}
$map['promote_id'] = ['in', $ids];
$map['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1'];
$oldMap = $map;
$records = [];
foreach ($dayList as $day) {
$time = strtotime($day);
$oldMap['pay_time'] = ['lt', $time];
$map['pay_time'] = ['between', [$time, ($time + 24 * 3600 -1)]];
$oldQuery = M('spend', 'tab_')->field('user_id')->where($oldMap)->group('user_id')->buildSql();
$map['user_id'] = ['exp', ' not in (' . $oldQuery . ')'];
$result = M('spend', 'tab_')->field('sum(pay_amount) amount')->where($map)->find();
$records[$day] = floatval($result['amount']);
}
return $records;
}
/**
* 统计给定时间前的付费玩家总数
*/
public function getHistoryPayCountByDay($params) {
$dayList = $params['dayList'] ?? [];
$gameId = $params['game_id'] ?? 0;
$serverId = $params['server_id'] ?? 0;
$ids = $params['promote_id'] ?? [];
$isBan = $params['is_ban'] ?? false;
$map = [];
$map['pay_status']=1;
if ($gameId > 0) {
$map['game_id'] = $gameId;
}
if ($serverId > 0) {
$map['server_id'] = $serverId;
}
$map['promote_id'] = ['in', $ids];
$map['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1'];
$records = [];
foreach ($dayList as $day) {
$time = strtotime($day);
$map['pay_time'] = ['elt', $time];
$result = M('spend', 'tab_')->field('count(DISTINCT user_id) as count')->where($map)->find();
$records[$day] = $result['count'];
}
return $records;
}
}

@ -0,0 +1,134 @@
<?php
namespace Base\Repository;
class UserRepository {
public function __construct()
{
}
private function assembleDayRecords($items, $dayList, $valueColumn, $dayColumn = 'day')
{
$records = [];
foreach ($dayList as $day) {
$dayValue = 0;
foreach ($items as $item) {
if ($item[$dayColumn] == $day) {
$dayValue = $item[$valueColumn];
}
}
$records[$day] = $dayValue;
}
return $records;
}
/**
* 按照时间分组统计登录总数
*/
public function getLoginCountByDay($params) {
$beginTime = $params['begin_time'] ?? 0;
$endTime = $params['end_time'] ?? 0;
$gameId = $params['game_id'] ?? 0;
$serverId = $params['server_id'] ?? 0;
$ids = $params['promote_id'] ?? [];
$dayList = $params['dayList'] ?? [];
$map = [];
$map['login_time'] = ['between', [$beginTime, $endTime]];
if ($gameId > 0) {
$map['game_id'] = $gameId;
}
if ($serverId > 0) {
$map['server_id'] = $serverId;
}
$map['promote_id'] = ['in', $ids];
$items = M('user_login_record', 'tab_')->field('FROM_UNIXTIME(login_time, "%Y-%m-%d") as day, count(DISTINCT user_id) as count')
->where($map)
->group('day')
->select();
return $this->assembleDayRecords($items, $dayList, 'count');
}
/**
* 按照时间分组统计注册总数
*/
public function getRegisterCountByDay($params) {
$beginTime = $params['begin_time'] ?? 0;
$endTime = $params['end_time'] ?? 0;
$gameId = $params['game_id'] ?? 0;
$serverId = $params['server_id'] ?? 0;
$ids = $params['promote_id'] ?? [];
$dayList = $params['dayList'] ?? [];
$dateform = '%Y-%m-%d';
$map = [];
$map['register_time'] = ['between', [$beginTime, $endTime]];
if ($gameId > 0) {
$map['fgame_id'] = $gameId;
}
$map['promote_id'] = ['in', $ids];
$map['puid'] = 0;
$items = M('user', 'tab_')->field('count(*) count, FROM_UNIXTIME(register_time,"'.$dateform.'") as day')
->where($map)
->group('day')
->select();
return $this->assembleDayRecords($items, $dayList, 'count');
}
/**
* 按照时间分组统计注册编号序列
* @param string $newslist 新玩家序列
* @param integer $end 结束时间(时间戳)
* @param integer $game_id 游戏编号
* @param integer/string $promote_id 渠道编号或渠道编号列表字符串(字符串逗号分隔)
* @param integer $flag 留存类型
* @return array 详细数据
* @author 鹿文学
*/
public function getRatentionRate($newslist,$game_id=0,$promote_id=0,$flag=1) {
$map['lock_status']=1;
if($game_id>0) {
$map['up.game_id'] = $game_id;
}
$map['tab_user.promote_id'] = is_numeric($promote_id)?$promote_id:array('in',$promote_id);
$group = 'up.login_time';
$fieldname = 'retention_rate'.$flag;
foreach ($newslist as $value) {
$ct1 = strtotime("+$flag day",strtotime($value['time']));
$ct2 = strtotime("+1 day",$ct1)-1;
$map[$group] = array(array('egt',$ct1),array('elt',$ct2));
$map['user_id']=array('in',$value['id']);
$count = count(explode(',',$value['id']));
$d = $this
->field('count(distinct up.user_id) as '.$fieldname.' ,FROM_UNIXTIME(up.login_time,"%Y-%m-%d") as play_time')
->join('tab_user_login_record up on tab_user.id=up.user_id','right')
->where($map)
->group('play_time')
->select();
if ($d)
$data[]=array(
"play_time"=>$value['time'],
$fieldname=>($d[0][$fieldname]==0)?0:sprintf("%.2f",($d[0][$fieldname]/$count)*100)
);
}
return $data;
}
}

@ -4,6 +4,9 @@ namespace Home\Controller;
use OT\DataDictionary;
use User\Api\PromoteApi;
use Base\Repository\PromoteRepository;
use Base\Repository\SpendRepository;
use Base\Repository\UserRepository;
/**
* 前台首页控制器
@ -634,6 +637,86 @@ class QueryController extends BaseController
}
}
private function getDayList($beginTime, $endTime)
{
$dayList = [];
do {
$dayList[] = date('Y-m-d', $beginTime);
$beginTime += 24*60*60;
} while($beginTime < $endTime);
return $dayList;
}
public function arpu()
{
$this->meta_title = 'ARPU统计';
$defaultTime = date('Y-m-d', time() - 7*24*3600) . ' 至 ' . date('Y-m-d');
$time = I('time', $defaultTime);
$sdkVersion = I('sdk_version', 0);
$gameId = I('game_id', 0);
$serverId = I('server_id', 0);
$promote = $this->getLoginPromote();
$map = [
'_logic' => 'or',
'id' => $promote['id'],
'parent_id' => $promote['id'],
'grand_id' => $promote['id'],
];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
$params = [];
if ($gameId > 0) {
$params['game_id'] = $gameId;
}
if ($serverId > 0) {
$params['server_id'] = $serverId;
}
if ($sdkVersion > 0) {
$params['sdk_version'] = $sdkVersion;
}
$params['promote_id'] = $ids;
list($beginTime, $endTime) = $this->getBetweenTime($time);
$params['begin_time'] = $beginTime;
$params['end_time'] = $endTime;
$dayList = $this->getDayList($beginTime, $endTime);
$params['dayList'] = $dayList;
$userRepository = new UserRepository();
$spendRepository = new SpendRepository();
$payGameCountList = $spendRepository->getPayGameCountByDay($params);
$payUserCountList = $spendRepository->getPayUserCountByDay($params);
$newPayUserCountList = $spendRepository->getNewPayUserCountByDay($params);
$payAmountList = $spendRepository->getPayAmountByDay($params);
$newPayAmountList = $spendRepository->getNewPayAmountByDay($params);
$historyPayCountList = $spendRepository->getHistoryPayCountByDay($params);
$loginCountList = $userRepository->getLoginCountByDay($params);
$registerCountList = $userRepository->getRegisterCountByDay($params);
$records = [];
foreach ($dayList as $day) {
$records[] = [
'day' => $day,
'payGameCount' => $payGameCountList[$day],
'payUserCount' => $payUserCountList[$day],
'newPayUserCount' => $newPayUserCountList[$day],
'payAmount' => number_format($payAmountList[$day], 2),
'newPayAmount' => number_format($newPayAmountList[$day], 2),
'historyPayCount' => $historyPayCountList[$day],
'loginCount' => $loginCountList[$day],
'registerCount' => $registerCountList[$day],
'payRate' => $loginCountList[$day] == 0 ? '--' : round($payUserCountList[$day]/$loginCountList[$day]*100, 2) . '%',
'ratentionOneDay' => '--',
'arpu' => $loginCountList[$day] == 0 ? '0.00' : number_format(round($payAmount[$day]/$loginCountList[$day], 2), 2),
'arppu' => $payUserCount[$day] == 0 ? '0.00' : number_format(round($payAmount[$day]/$payUserCount[$day], 2), 2),
];
}
$this->assign('records', $records);
$this->display();
}
public function arpu_analysis()
{
@ -707,7 +790,7 @@ class QueryController extends BaseController
}
$spend2 = D('Spend');
$data = M('Game', 'tab_')->field('id as game_id, game_name')->order('id desc')->select();
$data = M('Apply', 'tab_')->field('game_id, game_name')->where(['promote_id' => $promote_id])->order('game_id desc')->select();
foreach ($data as $key => $value) {
$game_id = $value['game_id'];
$map_list['game_id'] = $game_id;
@ -1906,4 +1989,129 @@ class QueryController extends BaseController
$this->meta_title = "订单详情";
$this->display('view_spend_detailed');
}
private function getBetweenTime($time, $defaultBegin = 0, $defaultEnd = 0)
{
$delimiter = ' 至 ';
$begin = $defaultBegin;
$end = $defaultEnd;
if ($time != '') {
if (strpos($time, $delimiter) == -1) {
$begin = strtotime($time . ' 00:00:00');
$end = strtotime($time . ' 23:59:59');
} else {
$timeRow = explode($delimiter, $time);
$begin = strtotime($timeRow[0] . ' 00:00:00');
$end = strtotime($timeRow[1] . ' 23:59:59');
}
}
return [$begin, $end];
}
public function achievement()
{
$time = I('time', date('Y-m-d'));
$sdkVersion = I('sdk_version', 0);
$gameId = I('game_id', 0);
$serverId = I('server_id', 0);
$parentId = I('parent_id', 0);
$loginPromote = $this->getLoginPromote();
$promote = null;
if ($parentId > 0) {
$promote = M('promote', 'tab_')->where(['id' => $parentId])->find();
} else {
$promote = $loginPromote;
}
$games = $this->getGamesByPromote($promote);
$subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promote['id']])->select();
$query = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promote['id']]);
list($promotes, $pagination, $count) = $this->paginate($query);
$ids = array_column($promotes, 'id');
$rows = [];
if (count($ids) > 0) {
$rows = M('promote', 'tab_')->field(['id', 'parent_id'])->where(['parent_id' => ['in', $ids]])->select();
}
$basicPromotes = [];
foreach ($rows as $row) {
$basicPromotes[$row['id']] = $row['parent_id'];
}
$params = [
'isContainSubs' => true,
'basicPromotes' => $basicPromotes,
];
if ($gameId > 0) {
$params['game_id'] = $gameId;
}
if ($serverId > 0) {
$params['server_id'] = $serverId;
}
if ($sdkVersion > 0) {
$params['sdk_version'] = $sdkVersion;
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$params['begin_time'] = $beginTime;
$params['end_time'] = $endTime;
$promoteRepository = new PromoteRepository();
$createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params);
$createRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds($ids, $params);
$newCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds($ids, $params);
$newCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds($ids, $params);
$newCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds($ids, $params);
$loginUserCountList = $promoteRepository->getLoginUserCountByIds($ids, $params);
$rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params);
$rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params);
$rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params);
$records = [];
foreach ($promotes as $promote) {
$id = $promote['id'];
$records[] = [
'id' => $id,
'account' => $promote['account'],
'real_name' => $promote['real_name'],
'create_role_count' => $createRoleCountList[$id],
'create_role_user_count' => $createRoleUserCountList[$id],
'new_create_role_user_count' => $newCreateRoleUserCountList[$id],
'new_create_role_device_count' => $newCreateRoleDeviceCountList[$id],
'new_create_role_ip_count' => $newCreateRoleIpCountList[$id],
'login_user_count' => $loginUserCountList[$id],
'recharge_count' => $rechargeCountList[$id],
'recharge_user_count' => $rechargeUserCountList[$id],
'recharge_amount' => $rechargeAmountList[$id]['ban_coin'] + $rechargeAmountList[$id]['coin'] + $rechargeAmountList[$id]['cash'],
'recharge_by_ban_coin' => $rechargeAmountList[$id]['ban_coin'],
'recharge_by_coin' => $rechargeAmountList[$id]['coin'],
'recharge_by_cash' => $rechargeAmountList[$id]['cash'],
];
}
$level = 0;
if ($parentId > 0) {
$level = 2;
} elseif ($loginPromote['parent_id'] == 0) {
$level = 1;
} elseif ($loginPromote['parent_id'] > 0 && $loginPromote['grand_id'] == 0) {
$level = 2;
} elseif ($loginPromote['parent_id'] > 0 && $loginPromote['grand_id'] > 0) {
$level = 3;
}
$this->assign('games', $games);
$this->assign('level', $level);
$this->assign('subPromotes', $subPromotes);
$this->assign('records', $records);
$this->assign('pagination', $pagination);
$this->assign('count', $count);
$this->display();
}
}

@ -112,9 +112,9 @@ class SpendModel extends Model{
$field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as pay_time,user_id as pay_num';
$sql = $this->field($field)->where($map)->group('pay_time')->select(false);
$subTable = $this->field($field)->where($map)->group('pay_time')->buildSql();
return $this->field('a.pay_time,count(distinct a.pay_num) as pay_num')->table('('.$sql.') as a')->group('a.pay_time')->select();
return $this->field('a.pay_time,count(distinct a.pay_num) as pay_num')->table('(' . $subTable . ') as a')->group('a.pay_time')->select();
}

@ -47,17 +47,18 @@
<a href="{:U('Promote/mygrand')}" class="<if condition='CONTROLLER_NAME eq Promote and (ACTION_NAME eq mygrand or ACTION_NAME eq add_chlid or ACTION_NAME eq edit_chlid) '>active</if> ">推广员管理</a>
</if>
</div>
<!-- <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/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/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/arpu_analysis')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq arpu_analysis '>active</if> ">ARPU统计</a>-->
<!-- <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/userRecharges')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRecharges '>active</if> ">充值玩家</a>-->
<!-- </div>-->
<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/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/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/arpu_analysis')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq arpu_analysis '>active</if> ">ARPU统计</a>
<!-- <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/userRecharges')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRecharges '>active</if> ">充值玩家</a>
<a href="{:U('Query/achievement')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq achievement '>active</if> ">团队/推广员业绩</a>
</div>
<!-- <div class="subNav jssubNav"><i class="prev_icon icon_caiwu"></i><span>财务管理</span><i class="arrow_icon"></i></div> -->
<!-- <div class="navContent jsnavContent"> -->

@ -0,0 +1,186 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
<style>
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
</style>
</block>
<block name="body">
<div class="page-list normal_list promote-mychlid-list">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据中心></span><span>团队推广业绩</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png">
<span class="title_main">团队推广业绩</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/achievement',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') eq $game['game_id']">selected</if>>{$game.game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}" >
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space">
<select name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<div class="form-group normal_space">
<select name="status" class="reselect select_gallery" style="width: 220px;" >
<option value="0">帐号状态</option>
<option value="1" <if condition="I('status') === '1'">selected</if>>正常</option>
<option value="2" <if condition="I('status') === '2'">selected</if>>冻结</option>
</select>
</div>
<if condition="$parent_id eq 0">
<div class="form-group normal_space">
<select name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择组长</option>
<volist name="subPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>
</if>
<if condition="$parent_id gt 0 and $grand_id eq 0">
<div class="form-group normal_space">
<select name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广员</option>
<volist name="subPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>
</if>
<div class="form-group normal_space fr">
<label>起止时间:</label>
<input type="text" class="txt range-date" name="time" placeholder="起止时间" value="{:I('time')}" >
</div>
<div class="form-group">
<input type="submit" class="submit normal_space" value="查询">
</div>
</form>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
<tr class="odd">
<th>账号(姓名)</th>
<th>创角数</th>
<th>创角用户</th>
<th>新创角用户</th>
<th>新创角设备</th>
<th>新创角IP</th>
<th>登录用户数</th>
<th>充值人数</th>
<th>充值次数</th>
<th>充值总额</th>
<th>现金充值</th>
<th>通用币充值</th>
<th>绑定币充值</th>
<?php if($level == 1):?>
<th>操作</th>
<?php endif;?>
</tr>
<empty name="records">
<tr><td colspan="14" style="text-align: center;height: 45vh;"><img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p></td></tr>
<else />
<volist name="records" id="record" mod="2">
<tr data-id="{$vo.id}" class="<eq name='mod' value='1'>odd</eq>">
<td>{$record.account}({$record.real_name})</td>
<td>{$record.create_role_count}</td>
<td>{$record.create_role_user_count}</td>
<td>{$record.new_create_role_user_count}</td>
<td>{$record.new_create_role_device_count}</td>
<td>{$record.new_create_role_ip_count}</td>
<td>{$record.login_user_count}</td>
<td>{$record.recharge_count}</td>
<td>{$record.recharge_user_count}</td>
<td>{$record.recharge_amount}</td>
<td>{$record.recharge_by_cash}</td>
<td>{$record.recharge_by_coin}</td>
<td>{$record.recharge_by_ban_coin}</td>
<?php if($level == 1):?>
<td><a href="{:U('Query/achievement', ['parent_id' => $record['id']])}">查看下级</a></td>
<?php endif;?>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
{$pagination}
</div>
</div>
<div class="page-explain promote-mychlid-explain">
<div class="trunk-content article border_normal">
<!-- <table class="desccontent">
<tr><td class="title" style="width: 100px;display: inline-block;">二级渠道说明:</td><td class="det">推广员默认为一级渠道,一级渠道可通过推广员后台新增二级渠道;二级渠道由一级渠道管理开启权限,并由一级渠道给二级渠道结算,结算可到财务管理操作。</td></tr>
</table>-->
</div>
</div>
</div>
</block>
<block name="script">
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript">
$(function() {
$('.range-date').flatpickr({
mode: 'range',
locale: 'zh',
})
$('.select_gallery').select2()
var gameId = $('#game-select').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, defaultServerId)
$('#game-select').on({
change: function name() {
gameId = $('#game-select').val()
getGameServers(gameId, 0)
}
})
function getGameServers(gameId, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
var selected = ''
if (defaultServerId > 0 && server.id==defaultServerId) {
selected = 'selected'
}
options += '<option value="' + server.id + '"' + selected + '>' + server.server_name + '</option>'
}
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
})
</script>
</block>

@ -0,0 +1,447 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/data.css" rel="stylesheet">
<link href="__CSS__/20180207/finance.css" rel="stylesheet">
<style type="text/css">
.keywords_information {margin-left:15px;cursor:pointer;}
.keywords_information .keywords_mark {height:35px;line-height:35px;color:#4A90F0;}
.keywords_information .keywords_mark span{border-bottom:1px solid transparent;}
.keywords_information .keywords_mark:hover span {border-bottom-color:#4A90F0;}
.keywords_information .keywords_content {transition:opacity 1.2s,visibility 1.5s;}
.keywords_information .keywords_content:before {margin-left:41px;}
.keywords_information .keywords_content .keywords_close {position:absolute;right:0;top:0;width:25px;height:40px;line-height:35px;color:#515974;}
.keywords_information .keywords_list span:first-child {width:160px;}
.keywords_information .keywords_list span:last-child {width:228px;}
.keywords_information {position:relative;display:inline-block;}
.keywords_information .keywords_mark {display:block;font-size:12px;font-style:normal;font-weight:normal; }
.keywords_information .keywords_content.active {visibility:visible;opacity:1;transition:visibility 1.5s,opacity 1s;}
.keywords_information .keywords_content {visibility:hidden;opacity:0;
position:absolute;width:435px;z-index:10;background:#fff;border-radius:5px;
border: 1px solid #E7ECEF;
box-shadow: 1px 1px 15px rgba(0,0,0,.1);
top:10px;left:72px;
}
.keywords_information .keywords_title {
height:40px;line-height:40px;background-color:#FAFAFA;
border-top-left-radius:5px;border-top-right-radius:5px;color:#515974;
padding-left:10px;font-size:12px;
}
.keywords_information .keywords_list {overflow:hidden;clear:both;padding:5px;margin:0 8px;font-size:10px;border-bottom:1px solid #EBEEF5;}
.keywords_information .keywords_list:last-child {border-bottom:none;}
.keywords_information .keywords_list span {display:inline-block;display: block;font-weight: normal;color: #515974;
float: left;
line-height: 30px;
width: 420px;}
.keywords_information .keywords_list span:last-child{color: #a5a6bb;}
.keywords_information .keywords_list span:first-child {width:160px;margin-right:20px;}
.chakan{
font-size: 14px;
font-weight: normal;
color: #26C7DB;
cursor: pointer;
display: inline-block;
text-align: center;
}
.chakan:hover{color: #2bd8ed;}
.trunk-list{position: relative;min-height: 66vh;}
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
.form-group .txt {
width: 180px;
height: 34px;
}
</style>
</block>
<block name="body">
<div class="page-search normal_list query-recharge-search">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据管理></span><span>ARPU统计</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_ARPU.png">
<span class="title_main">ARPU统计</span>
<span class="details">根据日期游戏推广员分析ARPU等相关数据信息排除绑币</span>
<div class="keywords_information" style="clear: both;">
<i class="keywords_mark"><span>关键词说明</span></i>
<ul class="keywords_content">
<li class="keywords_title">关键词说明<a href="javascript:;" class="keywords_close"><img src="__IMG__/20180207/btn_normal_close.png"/></a></li>
<li class="keywords_list">
<span class="">活跃用户</span>
<span class="">当天登录的用户总数</span>
</li>
<li class="keywords_list">
<span class="">付费用户</span>
<span class="">当天付费的用户数量</span>
</li>
<li class="keywords_list">
<span class="">新增付费用户</span>
<span class="">当天付费用户中第一次付费的用户数</span>
</li>
<li class="keywords_list">
<span class="">新增付费额</span>
<span class="">第一次付费的玩家当天充值总额</span>
</li>
<li class="keywords_list">
<span class="">付费率</span>
<span class="">付费用户/活跃用户</span>
</li>
<li class="keywords_list">
<span class="">ARPU(每用户平均付费)</span>
<span class="">当日总充值/活跃用户数</span>
</li>
<li class="keywords_list">
<span class="">ARPPU(付费用户的平均付费)</span>
<span class="">当日总充值/付费用户数</span>
</li>
</ul>
</div>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/arpu_analysis',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') eq $game['game_id']">selected</if>>{$game.game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space">
<select name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<div class="form-group normal_space">
<select name="status" class="reselect select_gallery" style="width: 220px;" >
<option value="0">帐号状态</option>
<option value="1" <if condition="I('status') === '1'">selected</if>>正常</option>
<option value="2" <if condition="I('status') === '2'">selected</if>>冻结</option>
</select>
</div>
<if condition="$parent_id eq 0">
<div class="form-group normal_space">
<select name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择组长</option>
<volist name="subPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>
</if>
<if condition="$parent_id gt 0 and $grand_id eq 0">
<div class="form-group normal_space">
<select name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广员</option>
<volist name="subPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>
</if>
<div class="form-group normal_space">
<label>起止时间:</label>
<input type="text" class="txt range-date" name="time" placeholder="起止时间" value="{:I('time')}" >
</div>
<div class="form-group">
<input type="submit" class="submit normal_space" value="查询">
</div>
</form>
</div>
</div>
<div class="page-list query-recharge-list">
<div class="trunk-content article">
<div class="trunk-list">
<table class="table normal_table" id="datacontent">
<table class="table normal_table" id="datatable" style="<notempty name='list_data'>display:none;</notempty>"><thead>
<tr class="odd">
<th>日期</th>
<if condition='empty(I("game_id")) != true'>
<th>游戏名称</th>
<else/>
<th>付费游戏数</th>
</if>
<if condition='empty(I("promote_id")) != true'>
<th>所属渠道</th>
</if>
<th>活跃用户</th>
<th>新增用户</th>
<th>付费用户</th>
<th>新增付费用户</th>
<th>付费总额</th>
<th>付费率</th>
<th>新增付费额</th>
<th>累计付费用户</th>
<th>1日留存</th>
<th>ARPU</th>
<th>ARPPU</th>
<if condition='empty(I("game_id")) == true'>
<th>详情</th>
</if>
</tr></thead><tbody>
<empty name="records">
<tr><td colspan="12" style="text-align: center;height: 45vh;"><img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p></td></tr>
<else />
<volist name="records" id="vo" mod="2">
<tr name="rows" class="<eq name='mod' value='1'>odd</eq>">
<td>{$vo.day}</td>
<if condition='empty(I("game_id")) != true'>
<th>{:I("game_name")}</th>
<else/>
<td>{$vo.payGameCount}</th>
</if>
<if condition='empty(I("promote_id")) != true'>
<th>{:I("promote_account")}</th>
</if>
<td>{$vo.loginCount}</td>
<td>{$vo.registerCount}</td>
<td>{$vo.payUserCount}</td>
<td>{$vo.newPayUserCount}</td>
<td>{$vo.payAmount}</td>
<td>{$vo.payRate}</td>
<td>{$vo.newPayAmount}</td>
<td>{$vo.historyPayCount}</td>
<td>{$vo.ratentionOneDay}</td>
<td>{$vo.arpu}</td>
<td>{$vo.arppu}</td>
<if condition='empty(I("game_id")) == true'>
<td>
<a onclick="chakan('{$key}')" style="cursor: pointer" class="chakan">查看</a>
</td>
</if>
</tr>
</volist>
</empty></tbody>
</table>
</table>
</div>
</div>
</div>
</div>
</block>
<block name="script">
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/20170831/pagination.js"></script>
<script type="text/javascript" src="__JS__/20170831/string.js"></script>
<script type="text/javascript" src="__JS__/20170831/tabpage.js"></script>
<eq name='timeout' value='1'>
<script>
layer.msg('时间间隔不能超过90天');
</script>
</eq>
<script>
$('.range-date').flatpickr({
mode: 'range',
locale: 'zh',
})
var gameId = $('#game-select').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, defaultServerId)
$('#game-select').on({
change: function name() {
gameId = $('#game-select').val()
getGameServers(gameId, 0)
}
})
function getGameServers(gameId, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
var selected = ''
if (defaultServerId > 0 && server.id==defaultServerId) {
selected = 'selected'
}
options += '<option value="' + server.id + '"' + selected + '>' + server.server_name + '</option>'
}
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
var parentId = $('#group-select').val();
var defaultPromoteId = $('#promote-select').attr('data-promote');
getSubPromotes(parentId, defaultPromoteId)
$('#group-select').on({
change: function name() {
parentId = $('#group-select').val()
getSubPromotes(parentId, 0)
}
})
function getSubPromotes(parentId, defaultPromoteId) {
$.ajax({
url: "{:U('Query/getSubPromotes')}",
dataType: 'json',
data: {promote_id: parentId},
success: function(response) {
var options = '<option value="0">请选择推广员</option>'
for (var i in response.data.promotes) {
var promote = response.data.promotes[i]
var selected = ''
if (defaultPromoteId > 0 && promote.id==defaultPromoteId) {
selected = 'selected'
}
options += '<option value="' + promote.id + '"' + selected + '>' + promote.account + '</option>'
}
$('#promote-select').html(options)
$("#promote-select").val(defaultPromoteId).trigger("change")
}
})
}
$('.range-date').flatpickr({
mode: 'range',
locale: 'zh',
})
layer.config({
extend: 'skin/myskin/style.css', //同样需要加载新皮肤
});
function chakan(key) {
var bangbi = $('#bangbi').val();
var promote_id = $('#promote_arpu').val();
url = "/index.php?s=/Home/Query/cha_userarpu/time/"+key+"/bangbi/"+bangbi+"/promote_id/"+promote_id;
timetitle = key;
console.log(url);
layer.open({
type: 2,
title: false,
closeBtn: 0, //不显示关闭按钮
shade: [0],
area: ['1px', '1px'],
offset: 'rb', //右下角弹出
time: 1, // 秒后自动关闭 这里设置成1ms 不显示过度页面
anim: 2,
content: ['', 'no'], //iframe的urlno代表不显示滚动条
end: function () { //
layer.open({
type: 2,
title: timetitle + '游戏数据',
skin: 'myskin', //只对该层采用myskin皮肤
shadeClose: true,
shade: [0.3,'#273142'],
scrollbar :false,
maxmin: true, //开启最大化最小化按钮
area: ['70%', '50%'],
content: url//iframe的url
});
}
});
}
</script>
<script type="text/javascript">
setValue('promote_id',{$Think.request.promote_id|default=0});
setValue('game_id','{$Think.request.game_id|default=0}');
function pagechange(that){
tablePage('datatable', 'datacontent', 'pagenation', [1, 2, 4, 5, 6, 10], false,that.value);
var export_data = $('#export_data');
var url = export_data.attr('href');
url = url.replace('.html','').replace(/(&|\/)row(=|\/)\d*/gi,'').replace(/\/p\/\d*/gi,'');
export_data.attr('href',url+'/row/'+that.value);
}
function pagenation_click() {
$('#pagenation a').click(function() {
var that = $(this),p = that.text();console.log(p);
var export_data = $('#export_data');
var url = export_data.attr('href');
url = url.replace('.html','').replace(/(&|\/)row(=|\/)\d*/gi,'').replace(/\/p\/\d*/gi,'');
export_data.attr('href',url+'/p/'+p+'/row/'+that.value);
return false;
});
}
$().ready(function(){
$("#pagehtml a").on("click",function(event){
event.preventDefault();//使a自带的方法失效即无法调整到href中的URL(http://www.baidu.com)
var geturl = $(this).attr('href');
$('#data_form').attr('action',geturl);
$('#data_form').submit();
});
pagenation_click();
$(".submit").click(function(){
var sdate =$('#sdate').val();
var edate =$('#edate').val();
if(Date.parse(sdate) > Date.parse(edate)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
})
$(".select_gallery").select2();
tablePage('datatable', 'datacontent', 'pagenation', [1, 2, 4, 5, 6, 10], false);
$('.keywords_information .keywords_mark').click(function() {
var that = $(this).siblings().addClass('active');
console.log(that);
$(document).click(function(event) {
var e = event || window.event;
var target= $(e.target);
if (!target.hasClass('keywords_information') && target.closest('.keywords_information').length<1) {
that.removeClass('active');
}
});
that.find('.keywords_close').click(function() {
that.removeClass('active');
return false;
});
return false;
});
$("#game_id").change(function(){
var game_name = $('#game_id option:selected').text();
$("#game_name").val(game_name);
});
$("#promote_id").change(function(){
var account = $('#promote_id option:selected').text();
$("#promote_account").val(account);
})
});
</script>
</block>

@ -46,6 +46,18 @@
.chakan:hover{color: #2bd8ed;}
.trunk-list{position: relative;min-height: 66vh;}
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
.form-group .txt {
width: 180px;
height: 34px;
}
</style>
</block>
@ -95,43 +107,60 @@
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/arpu_analysis')}" method="post" enctype="multipart/form-data">
<div class="form-group normal_space fr">
<input type="submit" class="submit" value="查询">
<form action="{:U('Query/arpu_analysis',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') eq $game['game_id']">selected</if>>{$game.game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space fr">
<label class="form-title select-title">选择时间:</label>
<div class="select-time">
<input type="text" id="sdate" class="txt" autocomplete="off" name="time_start" placeholder="开始时间" value="{$Think.request.time_start}" >
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" id="edate" class="txt" autocomplete="off" name="time_end" placeholder="结束时间" value="{$Think.request.time_end}">
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space fr">
<label class="form-title select-title">推广员账号:</label>
<select id="promote_id" name="promote_id" class="reselect select_gallery" style="min-width:170px;">
<option game-id="0" value="0">推广员账号</option>
<option game-id="{:session('promote_auth.pid')}" value="{:session('promote_auth.pid')}">自己</option>
<volist name=":get_promote_chlid_account(PID)" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.account}</option>
</volist>
<div class="form-group normal_space">
<select name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<div class="form-group normal_space">
<select name="status" class="reselect select_gallery" style="width: 220px;" >
<option value="0">帐号状态</option>
<option value="1" <if condition="I('status') === '1'">selected</if>>正常</option>
<option value="2" <if condition="I('status') === '2'">selected</if>>冻结</option>
</select>
</div>
<if condition="$parent_id eq 0">
<div class="form-group normal_space">
<select name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择组长</option>
<volist name="subPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>
</if>
<if condition="$parent_id gt 0 and $grand_id eq 0">
<div class="form-group normal_space">
<select name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广员</option>
<volist name="subPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
<input type="hidden" id="promote_account" name="promote_account" value='{:I("promote_account")}'>
</div>
<div class="form-group normal_space fr">
<label class="form-title select-title">游戏名称:</label>
<select id="game_id" name="game_id" class="reselect select_gallery" style="width: 200px;">
<option game-id="0" value="0">请选择游戏</option>
<volist name=":get_game_list()" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option>
</volist>
</select>
<input type="hidden" id="game_name" name="game_name" value='{:I("game_name")}'>
<input type="hidden" id="promote_arpu" name="promote_arpu" value='{$promote_arpu}'>
</if>
<div class="form-group normal_space">
<label>起止时间:</label>
<input type="text" class="txt range-date" name="time" placeholder="起止时间" value="{:I('time')}" >
</div>
<div class="form-group">
<input type="submit" class="submit normal_space" value="查询">
</div>
</form>
</div>
@ -204,13 +233,6 @@
</table>
<notempty name="list_data">
<div class="pagenation clearfix">
<a class="sch-btn" id="export_data" href="{:U('Export/arpu_analysis',array(
'game_id'=>I('game_id'),
'promote_id'=>I('promote_id'),
'time_start'=>I('time_start'),
'time_end'=>I('time_end'),'game_name'=>I('post.game_name'),'promote_account'=>I('post.promote_account'),
'xlsname'=>'数据管理_ARPU统计'
))}" >导出</a>
<div>
<select id="pagechange" name="row" onchange="pagechange(this)">
<option value="10">每页10条</option><option value="25">每页25条</option><option value="50">每页50条</option><option value="100">每页100条</option></select>
@ -226,9 +248,9 @@
</div>
</block>
<block name="script">
<link rel="stylesheet" type="text/css" href="__CSS__/p_jquery.datetimepicker.css">
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/jquery.datetimepicker.js"></script>
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/20170831/pagination.js"></script>
<script type="text/javascript" src="__JS__/20170831/string.js"></script>
@ -239,6 +261,10 @@
</script>
</eq>
<script>
$('.range-date').flatpickr({
mode: 'range',
locale: 'zh',
})
layer.config({
extend: 'skin/myskin/style.css', //同样需要加载新皮肤
});
@ -324,28 +350,9 @@ $().ready(function(){
return false;
}
})
$('#sdate').datetimepicker({
lang:'ch',
format:'Y-m-d',
formatDate:'Y-m-d',
scrollMonth:false,
scrollTime:false,
scrollInput:false,
timepicker:false
});
$(".select_gallery").select2();
$('#edate').datetimepicker({
lang:'ch',
format:'Y-m-d',
formatDate:'Y-m-d',
scrollMonth:false,
scrollTime:false,
scrollInput:false,
timepicker:false
});
tablePage('datatable', 'datacontent', 'pagenation', [1, 2, 4, 5, 6, 10], false);

@ -33,11 +33,8 @@
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" >
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}">
<option value="0">请选择区服</option>
<volist name="groupPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}">{$promote.account}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
@ -59,7 +56,7 @@
</if>
<if condition="$grand_id eq 0">
<div class="form-group normal_space">
<select id="promote-select" name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<select id="promote-select" name="promote_id" class="reselect select_gallery" style="width: 220px;" data-promote="{:I('promote_id', 0)}">
<option value="0">请选择推广员</option>
<volist name="promotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
@ -86,7 +83,7 @@
<input type="submit" class="submit" value="查询">
</div>
<div class="form-group normal_space">
<label><input name="is_self" value="1" type="checkbox"> 本账号推广</label>
<label><input name="is_self" value="1" <if condition="I('is_self') == 1">checked</if> type="checkbox"> 本账号推广</label>
</div>
</form>
</div>
@ -130,11 +127,7 @@
</div>
<div class="pagenation clearfix">
<a class="sch-btn" href="{:U('Export/child',array(
'p'=>I('p'),
'account'=>I('account'),'xlsname'=>'管理中心_'.get_pro_grade_name(PRO_GRADE,1),'row'=>I('request.row')
))}" >导出</a>
{$_page}
{$pagination}
</div>
</div>
<div class="page-explain promote-mychlid-explain">
@ -151,44 +144,66 @@
<script type="text/javascript">
$(function(){
$(".select_gallery").select2();
var gameId = $('#game-select').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, defaultServerId)
$('#game-select').on({
change: function name() {
var gameId = $('#game-select').val()
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId},
success: function(response) {
$("#server-select").val(0).trigger("change")
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
options += '<option value="' + server.id + '">' + server.server_name + '</option>'
}
$('#server-select').html(options)
}
})
gameId = $('#game-select').val()
getGameServers(gameId, 0)
}
})
$('#group-select').on({
change: function name() {
var groupId = $('#group-select').val()
$.ajax({
url: "{:U('Query/getSubPromotes')}",
dataType: 'json',
data: {promote_id: groupId},
success: function(response) {
$("#promote-select").val(0).trigger("change")
var options = '<option value="0">请选择推广员</option>'
for (var i in response.data.promotes) {
var promote = response.data.promotes[i]
options += '<option value="' + promote.id + '">' + promote.account + '</option>'
function getGameServers(gameId, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
var selected = ''
if (defaultServerId > 0 && server.id==defaultServerId) {
selected = 'selected'
}
$('#promote-select').html(options)
options += '<option value="' + server.id + '"' + selected + '>' + server.server_name + '</option>'
}
})
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
var parentId = $('#group-select').val();
var defaultPromoteId = $('#promote-select').attr('data-promote');
getSubPromotes(parentId, defaultPromoteId)
$('#group-select').on({
change: function name() {
parentId = $('#group-select').val()
getSubPromotes(parentId, 0)
}
})
function getSubPromotes(parentId, defaultPromoteId) {
$.ajax({
url: "{:U('Query/getSubPromotes')}",
dataType: 'json',
data: {promote_id: parentId},
success: function(response) {
var options = '<option value="0">请选择推广员</option>'
for (var i in response.data.promotes) {
var promote = response.data.promotes[i]
var selected = ''
if (defaultPromoteId > 0 && promote.id==defaultPromoteId) {
selected = 'selected'
}
options += '<option value="' + promote.id + '"' + selected + '>' + promote.account + '</option>'
}
$('#promote-select').html(options)
$("#promote-select").val(defaultPromoteId).trigger("change")
}
})
}
})
</script>
</block>

@ -33,11 +33,8 @@
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" >
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}">
<option value="0">请选择区服</option>
<volist name="groupPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}">{$promote.account}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
@ -65,7 +62,7 @@
</if>
<if condition="$grand_id eq 0">
<div class="form-group normal_space">
<select id="promote-select" name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<select id="promote-select" name="promote_id" class="reselect select_gallery" style="width: 220px;" data-promote="{:I('promote_id', 0)}">
<option value="0">请选择推广员</option>
<volist name="promotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
@ -87,7 +84,7 @@
<input type="submit" class="submit normal_space" value="查询">
</div>
<div class="form-group normal_space">
<label><input name="is_self" value="1" type="checkbox"> 本账号推广</label>
<label><input name="is_self" value="1" type="checkbox" <if condition="I('is_self') == 1">checked</if>> 本账号推广</label>
</div>
</form>
</div>
@ -123,11 +120,7 @@
</div>
<div class="pagenation clearfix">
<a class="sch-btn" href="{:U('Export/child',array(
'p'=>I('p'),
'account'=>I('account'),'xlsname'=>'管理中心_'.get_pro_grade_name(PRO_GRADE,1),'row'=>I('request.row')
))}" >导出</a>
{$_page}
{$pagination}
</div>
</div>
<div class="page-explain promote-mychlid-explain">
@ -151,44 +144,66 @@ $(function() {
locale: 'zh',
})
$('.select_gallery').select2()
var gameId = $('#game-select').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, defaultServerId)
$('#game-select').on({
change: function name() {
var gameId = $('#game-select').val()
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId},
success: function(response) {
$("#server-select").val(0).trigger("change")
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
options += '<option value="' + server.id + '">' + server.server_name + '</option>'
}
$('#server-select').html(options)
}
})
gameId = $('#game-select').val()
getGameServers(gameId, 0)
}
})
$('#group-select').on({
change: function name() {
var groupId = $('#group-select').val()
$.ajax({
url: "{:U('Query/getSubPromotes')}",
dataType: 'json',
data: {promote_id: groupId},
success: function(response) {
$("#promote-select").val(0).trigger("change")
var options = '<option value="0">请选择推广员</option>'
for (var i in response.data.promotes) {
var promote = response.data.promotes[i]
options += '<option value="' + promote.id + '">' + promote.account + '</option>'
function getGameServers(gameId, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
var selected = ''
if (defaultServerId > 0 && server.id==defaultServerId) {
selected = 'selected'
}
$('#promote-select').html(options)
options += '<option value="' + server.id + '"' + selected + '>' + server.server_name + '</option>'
}
})
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
var parentId = $('#group-select').val();
var defaultPromoteId = $('#promote-select').attr('data-promote');
getSubPromotes(parentId, defaultPromoteId)
$('#group-select').on({
change: function name() {
parentId = $('#group-select').val()
getSubPromotes(parentId, 0)
}
})
function getSubPromotes(parentId, defaultPromoteId) {
$.ajax({
url: "{:U('Query/getSubPromotes')}",
dataType: 'json',
data: {promote_id: parentId},
success: function(response) {
var options = '<option value="0">请选择推广员</option>'
for (var i in response.data.promotes) {
var promote = response.data.promotes[i]
var selected = ''
if (defaultPromoteId > 0 && promote.id==defaultPromoteId) {
selected = 'selected'
}
options += '<option value="' + promote.id + '"' + selected + '>' + promote.account + '</option>'
}
$('#promote-select').html(options)
$("#promote-select").val(defaultPromoteId).trigger("change")
}
})
}
})
</script>
</block>

@ -59,7 +59,7 @@ INSERT INTO `tab_promote_quick_menu` VALUES ('15', '1', '9', '1569719870');
INSERT INTO `tab_promote_quick_menu` VALUES ('16', '1', '10', '1569719877');
INSERT INTO `tab_promote_quick_menu` VALUES ('18', '1', '1', '1569720739');
-- 2019-10-01
-- 2019-10-01 by elf
alter table tab_game_source add column `original_url` varchar(255) NOT NULL default '' COMMENT '原包路径';
alter table tab_game_source add column `org_plist_url` varchar(255) NOT NULL default '' COMMENT '原包Plist路径';
@ -131,4 +131,9 @@ CREATE TABLE `tab_test_resource` (
KEY `game_id` (`game_id`) USING BTREE,
KEY `promote_id` (`promote_id`) USING BTREE,
KEY `create_time` (`create_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='测试资源申请';
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='测试资源申请';
-- 2019-10-09 by elf
alter table tab_user_play_info add column `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '角色创建时间';
alter table tab_user_play_info add column `create_ip` varchar(16) NOT NULL DEFAULT '' COMMENT '角色创建IP';
alter table tab_user_play_info add column `create_device_number` varchar(50) NOT NULL DEFAULT '' COMMENT '角色创建设备号';

Loading…
Cancel
Save