推广平台>数据管理--新增推广员指标

master
chenxiaojun 5 years ago
commit e48056686d

@ -45,7 +45,10 @@ class PromoteRepository {
if (isset($params['sdk_version'])) {
$map['sdk_version'] = $params['sdk_version'];
}
if (isset($params['begin_time']) && isset($params['begin_time']) && isset($params['time_column'])) {
if (isset($params['role_level'])) {
$map['role_level'] = $params['role_level'];
}
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 (isset($params['lock_status'])) {

@ -1447,6 +1447,183 @@ class DownloadController extends BaseController {
}
/*推广员指标查看详情 */
public function quotaDtl_data_export() {
$nowTime = date('Y-m-d', time());
$defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime;
$time = I('time', $defaultTime);
$relationGameId = I('relation_game_id', 0);
$sdkVersion = I('sdk_version', 0);
$serverId = I('server_id', 0);
$roleLevelBegin = intval(I('level_begin', 0));
$roleLevelEnd = intval(I('level_end', 0));
$promoteId = I('promote_id', 0);
$isSelf = I('is_self', 0);
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$map['game_id'] = ['in', $gameIds];
}
if ($serverId != 0) {
$map['server_id'] = $serverId;
}
if ($roleLevelBegin != 0 && $roleLevelEnd == 0) {
$map['role_level'] = ['egt', $roleLevelBegin];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin == 0) {
$map['role_level'] = ['elt', $roleLevelEnd];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin != 0) {
$map['role_level'] = ['between', [$roleLevelBegin, $roleLevelEnd]];
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$map['create_time'] = ['between', [$beginTime, $endTime]];
if ($promoteId) {
if ($isSelf) {
$map['promote_id'] = $promoteId;
} else {
$promote = M('promote', 'tab_')->field(['id', 'chain'])->where(array('id' => $promoteId))->find();
$promoteMap['chain'] = ['like', "{$promote['chain']}{$promote['id']}/%"];
$promoteIds = M('promote', 'tab_')->where($promoteMap)->getField('id', true);
$promoteIds[] = $promoteId;
$map['promote_id'] = ['in', $promoteIds];
}
} else {
$map = '1 = 2';
}
// $data = M('user_play_info', 'tab_')->where($map)->order('create_time desc')->select();
$conditions = json_encode($map,TRUE);
$addtime = time();
$data1 = [
'logid' => 'quotadtl_'.time(),
'promote_id' => PID,
'type' => '/Home/Query/promoteQuota',
'dataname' => '推广员详情',
'status' => 0,
'addtime' => $addtime,
'begintime' => 0,
'content' => '',
'conditions' =>$conditions
];
$res = M('downloadlog','tab_')->add($data1);
if (!$res) {
$this->error('添加下载失败');
}
$this->success('添加下载成功',U('listsIndex'));
}
/*推广指标首页导出*/
public function promoteQuota_data_export() {
$nowTime = date('Y-m-d', time());
$defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime;
$time = I('time', $defaultTime);
if (!empty($time)) {
$defaultTime = $time;
}
$sdkVersion = I('sdk_version', 0);
$relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$parentId = I('parent_id', 0);
$promoteId = I('promote_id', 0);
$levelBegin = I('level_begin', '');
$levelEnd = I('level_end', '');
$prevParentId = 0;
$promoteService = new PromoteService();
$loginPromote = $this->getLoginPromote();
$parent = null;
if ($parentId > 0) {
$parent = M('promote', 'tab_')->where(['id' => $parentId])->find();
$currentDisplay = $promoteService->getLevelName($parent['level']) . '推广';
$prevParentId = $parent['parent_id'] == $loginPromote['parent_id'] ? 0 : $parent['parent_id'];
} else {
$parent = $loginPromote;
$currentDisplay = '自己';
}
$map = ['parent_id' => $parent['id']];
if ($promoteId > 0) {
$map['id'] = $promoteId;
}
$data = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level'])->where($map)->select();
$ids = array_column($data, 'id');
$rows = [];
if (count($ids) > 0) {
$rows = M('promote', 'tab_')
->field(['id', 'chain'])
->where(['chain' => ['like', [$parent['chain'] . $parent['id'] . '/%']], 'level' => ['gt', $parent['level'] + 1]])
->select();
}
$basicPromotes = [];
foreach ($ids as $id) {
foreach ($rows as $row) {
$needChain = $parent['chain'] . $parent['id'] . '/' . $id . '/';
if (strpos($row['chain'], $needChain) !== false) {
$basicPromotes[$row['id']] = $id;
}
}
}
$map = [
'isContainSubs' => true,
'basicPromotes' => json_encode($basicPromotes,FALSE),
];
$map['promotes'] = json_encode($data,FALSE);
$map['parentsinfo'] = json_encode($parent,FALSE);;
$map['currentDisplay'] = $currentDisplay;
$map['ids'] = $ids;
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$map['game_id'] = ['in', $gameIds];
}
if ($serverId > 0) {
$map['server_id'] = $serverId;
}
$where = $map;
if ($sdkVersion != 0) {
$map['sdk_version'] = $sdkVersion;
}
if ($levelBegin !== '' || $levelEnd !== '') {
if ($levelBegin !== '' && $levelEnd !== '') {
$levelBegin = intval($levelBegin);
$levelEnd = intval($levelEnd);
if ($levelBegin > $levelEnd) {
$this->error('角色等级范围错误');
}
$map['role_level'] = ['between', [$levelBegin, $levelEnd]];
} elseif ($levelBegin !== '' && $levelEnd === '') {
$levelBegin = intval($levelBegin);
$map['role_level'] = ['egt', $levelBegin];
} elseif ($levelBegin === '' && $levelEnd !== '') {
$levelEnd = intval($levelEnd);
$map['role_level'] = ['elt', $levelEnd];
}
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$map['begin_time'] = $beginTime;
$map['end_time'] = $endTime;
$conditions = json_encode($map,TRUE);
$addtime = time();
$data1 = [
'logid' => 'quota_'.time(),
'promote_id' => PID,
'type' => '/Home/Query/promoteQuota',
'dataname' => '推广员指标',
'status' => 0,
'addtime' => $addtime,
'begintime' => 0,
'content' => '',
'conditions' =>$conditions
];
$res = M('downloadlog','tab_')->add($data1);
if (!$res) {
// $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res));
$this->error('添加下载失败');
}
$this->success('添加下载成功',U('listsIndex'));
}
public function achievement_data_export() {
$time = I('time', date('Y-m-d'));
$sdkVersion = I('sdk_version', 0);
@ -1863,15 +2040,142 @@ class DownloadController extends BaseController {
case "平台币充值":
$this->orderlistExcelInfo($id,$map);
break;
case "玩家行为日志";
case "玩家行为日志":
$this->playactionExcelInfo($id,$map);
break;
case "推广员指标":
$this->promotequotaExcelInfo($id,$map);
break;
case "推广员详情":
$this->promotequotaDtlExcelInfo($id,$map);
break;
default:
break;
}
}
public function promotequotaDtlExcelInfo($id,$map) {
$xlsName = "推广员详情";
$xlsCell = array(
array('user_account','玩家账号'),
array('promote_account','推广账号'),
array('game_name','游戏名称'),
array('sdk_version','平台'),
array('server_name','游戏区服'),
array('role_name','角色名'),
array('role_level','等级'),
array('create_time','创建时间'),
);
$records = M('user_play_info', 'tab_')->where($map)->order('create_time desc')->select();
foreach ($records as $key => $value) {
//订单隐藏算法
$orderLen = strlen($value['user_account']);
$strLen = 3;
$hideChar = '';
if ($orderLen <= 8) { $strLen = 2;}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
$records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen);
}
$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);
}
public function promotequotaExcelInfo($tid,$map) {
$xlsName = "推广员指标";
$xlsCell = array(
array('account','账号'),
array('real_name','姓名'),
array('game_name','游戏名称'),
array('sdk_version_text','平台'),
array('server_name','游戏区服'),
array('role_num','角色数量'),
);
$params['isContainSubs'] = $map['isContainSubs'];
$params['basicPromotes'] = json_decode($map['basicPromotes'],TRUE);
$ids = $map['ids'];
$promotes = json_decode($map["promotes"],TRUE);
if(!empty($map['game_id'])) {
$params['game_id'] = $map["game_id"];
}
if(!empty($map['server_id'])) {
$params['server_id'] = $map["server_id"];
}
if(!empty($map['sdk_version'])) {
$params['sdk_version'] = $map["sdk_version"];
}
if(!empty($map['role_level'])) {
$params['role_level'] = $map['role_level'];
unset($map['role_level']);
}
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'];
//var_dump($params);
$records = [];
$promoteRepository = new PromoteRepository();
$createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params);
$selfParams = $params;
$selfParams['isContainSubs'] = false;
$selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$parent['id']], $selfParams);
$game = $this->getgame($map);
$record = [
'id' => $parent['id'],
'account' => $parent['account'],
'real_name' => mb_strlen($parent['real_name'],'utf-8') == 2 ? mb_substr($parent['real_name'],0,1,'utf-8').'*':mb_substr($parent['real_name'],0,1,'utf-8').'**',
'level' => $parent['level'],
'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'],
'server_name' => $game['server_name'],
'role_num' => $selfCreateRoleCountList[$parent['id']],
'current_display' => $currentDisplay,
];
$records[] = $record;
foreach ($promotes as $promote) {
$id = $promote['id'];
$record = [
'id' => $id,
'account' => $promote['account'],
'real_name' => mb_strlen($promote['real_name'],'utf-8') == 2 ? mb_substr($promote['real_name'],0,1,'utf-8').'*':mb_substr($promote['real_name'],0,1,'utf-8').'**',
'level' => $promote['level'],
'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'],
'server_name' => $game['server_name'],
'role_num' => $createRoleCountList[$id],
'current_display' => '',
];
$records[] = $record;
}
$xlsData = [];
foreach ($records as $key1 => $value1) {
$value1['account'] = $this->encryption($value1['account']);
$xlsData[] = $value1;
}
$this->exportExcel($xlsName, $xlsCell, $xlsData,$tid);
}
public function playactionExcelInfo($id,$map) {
$xlsName = "玩家行为日志";
$xlsCell = array(
@ -3717,5 +4021,54 @@ class DownloadController extends BaseController {
return substr($string, 0, $strLen) . $hideChar . substr($string, $orderLen-$strLen);
}
private function getGame($map = [])
{
$gameName = '全部游戏';
$sdkVersionText = getSDKTypeName(0, true);
$serverName = '--';
if (isset($map['game_id']) || isset($map['sdk_version'])) {
$where = [];
if (!isset($map['game_id'])) {
$sdkVersionText = getSDKTypeName($map['sdk_version'], true);
} elseif (!isset($map['sdk_version'])) {
$where['id'] = $map['game_id'];
$gameName = M('game', 'tab_')->where($where)->getField('relation_game_name');
if (isset($map['server_id'])) {
$serverName = $this->getServerName($map['game_id'], 0, $map['server_id']);
}
} else {
$where['id'] = $map['game_id'];
$where['sdk_version'] = $map['sdk_version'];
$gameName = M('game', 'tab_')->where($where)->getField('game_name');
$sdkVersionText = getSDKTypeName($map['sdk_version'], true);
if (isset($map['server_id'])) {
$serverName = $this->getServerName($map['game_id'], $map['sdk_version'], $map['server_id']);
}
}
}
$game = [
'game_name' => $gameName,
'sdk_version_text' => $sdkVersionText,
'server_name' => $serverName,
];
return $game;
}
private function getServerName($gameIds, $serverVersion, $serverId)
{
$map['_string'] = '1 = 1';
if ($gameIds) {
$map['game_id'] = $gameIds;
}
if ($serverVersion) {
$map['server_version'] = $serverVersion;
}
if ($serverId) {
$map['server_id'] = $serverId;
}
return M('server', 'tab_')->where($map)->getField('server_name');
}
}

@ -2209,4 +2209,272 @@ class QueryController extends BaseController
$this->ajaxReturn($data);
}
//推广员指标管理
public function promoteQuota()
{
$nowTime = date('Y-m-d', time());
$defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime;
$time = I('time', $defaultTime);
if (!empty($time)) {
$defaultTime = $time;
}
$sdkVersion = I('sdk_version', 0);
$relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$parentId = I('parent_id', 0);
$promoteId = I('promote_id', 0);
$levelBegin = I('level_begin', '');
$levelEnd = I('level_end', '');
$prevParentId = 0;
$promoteService = new PromoteService();
$loginPromote = $this->getLoginPromote();
$parent = null;
if ($parentId > 0) {
$parent = M('promote', 'tab_')->where(['id' => $parentId])->find();
$currentDisplay = $promoteService->getLevelName($parent['level']) . '推广';
$prevParentId = $parent['parent_id'] == $loginPromote['parent_id'] ? 0 : $parent['parent_id'];
} else {
$parent = $loginPromote;
$currentDisplay = '自己';
}
$searchLevel = $parent['level'] + 1;
$searchLevelName = $promoteService->getLevelName($searchLevel);
$games = get_promote_serach_game();
$subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $parent['id']])->select();
$map = ['parent_id' => $parent['id']];
if ($promoteId > 0) {
$map['id'] = $promoteId;
}
$query = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level'])->where($map);
list($promotes, $pagination, $count) = $this->paginate($query);
$ids = array_column($promotes, 'id');
$rows = [];
if (count($ids) > 0) {
$rows = M('promote', 'tab_')
->field(['id', 'chain'])
->where(['chain' => ['like', [$parent['chain'] . $parent['id'] . '/%']], 'level' => ['gt', $parent['level'] + 1]])
->select();
}
$basicPromotes = [];
foreach ($ids as $id) {
foreach ($rows as $row) {
$needChain = $parent['chain'] . $parent['id'] . '/' . $id . '/';
if (strpos($row['chain'], $needChain) !== false) {
$basicPromotes[$row['id']] = $id;
}
}
}
$params = [
'isContainSubs' => true,
'basicPromotes' => $basicPromotes,
];
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$params['game_id'] = ['in', $gameIds];
}
if ($serverId > 0) {
$params['server_id'] = $serverId;
}
$where = $params;
if ($sdkVersion != 0) {
$where['sdk_version'] = $sdkVersion;
}
$game = $this->getGame($where);
if ($levelBegin !== '' || $levelEnd !== '') {
if ($levelBegin !== '' && $levelEnd !== '') {
$levelBegin = intval($levelBegin);
$levelEnd = intval($levelEnd);
if ($levelBegin > $levelEnd) {
$this->error('角色等级范围错误');
}
$params['role_level'] = ['between', [$levelBegin, $levelEnd]];
} elseif ($levelBegin !== '' && $levelEnd === '') {
$levelBegin = intval($levelBegin);
$params['role_level'] = ['egt', $levelBegin];
} elseif ($levelBegin === '' && $levelEnd !== '') {
$levelEnd = intval($levelEnd);
$params['role_level'] = ['elt', $levelEnd];
}
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$params['begin_time'] = $beginTime;
$params['end_time'] = $endTime;
$records = [];
$promoteRepository = new PromoteRepository();
$createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params);
if (I('p', 1) == 1) {
$selfParams = $params;
$selfParams['isContainSubs'] = false;
$selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$parent['id']], $selfParams);
$record = [
'id' => $parent['id'],
'account' => $parent['account'],
'real_name' => mb_strlen($parent['real_name'],'utf-8') == 2 ? mb_substr($parent['real_name'],0,1,'utf-8').'*':mb_substr($parent['real_name'],0,1,'utf-8').'**',
'level' => $parent['level'],
'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'],
'server_name' => $game['server_name'],
'role_num' => $selfCreateRoleCountList[$parent['id']],
'current_display' => $currentDisplay,
];
$records[] = $record;
}
foreach ($promotes as $promote) {
$id = $promote['id'];
$record = [
'id' => $id,
'account' => $promote['account'],
'real_name' => mb_strlen($promote['real_name'],'utf-8') == 2 ? mb_substr($promote['real_name'],0,1,'utf-8').'*':mb_substr($promote['real_name'],0,1,'utf-8').'**',
'level' => $promote['level'],
'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'],
'server_name' => $game['server_name'],
'role_num' => $createRoleCountList[$id],
'current_display' => '',
];
$records[] = $record;
}
$this->assign('prevParentId', $prevParentId);
$this->assign('searchLevelName', $searchLevelName);
$this->assign('games', $games);
$this->assign('parent', $parent);
$this->assign('subPromotes', $subPromotes);
$this->assign('records', $records);
$this->assign('pagination', $pagination);
$this->assign('parentId', $parentId);
$this->assign('count', $count);
$this->assign('time', $defaultTime);
$this->assign('meta_title', '推广员指标');
$this->display();
}
public function quotaDtl()
{
$nowTime = date('Y-m-d', time());
$defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime;
$time = I('time', $defaultTime);
$relationGameId = I('relation_game_id', 0);
$sdkVersion = I('sdk_version', 0);
$serverId = I('server_id', 0);
$roleLevelBegin = intval(I('level_begin', 0));
$roleLevelEnd = intval(I('level_end', 0));
$promoteId = I('promote_id', 0);
$isSelf = I('is_self', 0);
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$map['game_id'] = ['in', $gameIds];
}
if ($serverId != 0) {
$map['server_id'] = $serverId;
}
if ($roleLevelBegin != 0 && $roleLevelEnd == 0) {
$map['role_level'] = ['egt', $roleLevelBegin];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin == 0) {
$map['role_level'] = ['elt', $roleLevelEnd];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin != 0) {
$map['role_level'] = ['between', [$roleLevelBegin, $roleLevelEnd]];
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$map['create_time'] = ['between', [$beginTime, $endTime]];
if ($promoteId) {
if ($isSelf) {
$map['promote_id'] = $promoteId;
} else {
$promote = M('promote', 'tab_')->field(['id', 'chain'])->where(array('id' => $promoteId))->find();
$promoteMap['chain'] = ['like', "{$promote['chain']}{$promote['id']}/%"];
$promoteIds = M('promote', 'tab_')->where($promoteMap)->getField('id', true);
$promoteIds[] = $promoteId;
$map['promote_id'] = ['in', $promoteIds];
}
} else {
$map = '1 = 2';
}
$query = M('user_play_info', 'tab_')->where($map)->order('create_time desc');
list($records, $pagination, $count) = $this->paginate($query);
foreach ($records as $key => $value) {
//订单隐藏算法
$orderLen = strlen($value['user_account']);
$strLen = 3;
$hideChar = '';
if ($orderLen <= 8) {
$strLen = 2;
}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
$records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen);
}
$this->assign('records', $records);
$this->assign('pagination', $pagination);
$this->assign('count', $count);
$this->display();
}
private function getGame($map = [])
{
$gameName = '全部游戏';
$sdkVersionText = getSDKTypeName(0, true);
$serverName = '--';
if (isset($map['game_id']) || isset($map['sdk_version'])) {
$where = [];
if (!isset($map['game_id'])) {
$sdkVersionText = getSDKTypeName($map['sdk_version'], true);
} elseif (!isset($map['sdk_version'])) {
$where['id'] = $map['game_id'];
$gameName = M('game', 'tab_')->where($where)->getField('relation_game_name');
if (isset($map['server_id'])) {
$serverName = $this->getServerName($map['game_id'], 0, $map['server_id']);
}
} else {
$where['id'] = $map['game_id'];
$where['sdk_version'] = $map['sdk_version'];
$gameName = M('game', 'tab_')->where($where)->getField('game_name');
$sdkVersionText = getSDKTypeName($map['sdk_version'], true);
if (isset($map['server_id'])) {
$serverName = $this->getServerName($map['game_id'], $map['sdk_version'], $map['server_id']);
}
}
}
$game = [
'game_name' => $gameName,
'sdk_version_text' => $sdkVersionText,
'server_name' => $serverName,
];
return $game;
}
private function getServerName($gameIds, $serverVersion, $serverId)
{
$map['_string'] = '1 = 1';
if ($gameIds) {
$map['game_id'] = $gameIds;
}
if ($serverVersion) {
$map['server_version'] = $serverVersion;
}
if ($serverId) {
$map['server_id'] = $serverId;
}
return M('server', 'tab_')->where($map)->getField('server_name');
}
}

@ -72,6 +72,7 @@
<a href="{:U('Query/userRecharges')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRecharges '>active</if> ">充值玩家</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>
</div>
<?php endif;?>

@ -0,0 +1,189 @@
<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;
}
.btn-span {
color: #06c;
cursor: pointer;
}
</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>{$meta_title}</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png">
<span class="title_main">{$meta_title}</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/promoteQuota',['row'=>I('get.row')])}" method="post" enctype="multipart/form-data">
<input type="hidden" name="parent_id" value="{:I('parent_id', 0)}">
<div class="form-group normal_space">
<select name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择{$searchLevelName}</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}({$promote.real_name})</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="game-select" name="relation_game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.relation_game_id}" <if condition="I('relation_game_id') eq $game['relation_game_id']">selected</if>>{$game.relation_game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="sdk_version" 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 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 fr">
<input type="text" class="txt range-date" name="time" placeholder="创角时间" value="{$time}" >
</div>
<div class="form-group normal_space fr">
<label>角色等级:</label>
<input type="text" class="txt float-input" name="level_begin" style="width: 50px" value="{:I('level_begin')}" >
<label> ~ </label>
<input type="text" class="txt float-input" name="level_end" style="width: 50px" value="{:I('level_end')}" >
</div>
<div class="form-group">
<input type="submit" class="submit normal_space" value="查询">
</div>
<?php if ($prevParentId > 0):?>
<div class="form-group">
<a class="submit normal_space" href="{:U('Query/promoteQuota', ['row'=>I('get.row'), 'parent_id' => $prevParentId,'time'=>$time])}" style="line-height: 36px; display: inline-block; text-align: center; background: #E5E5E5; color: #2bd8ed; cursor: pointer;">返回上级</a>
</div>
<?php endif;?>
</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>操作</th>
</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})
<?php if($record['current_display'] != ''):?>
<span style="color: #06C;">[{$record['current_display']}]</span>
<?php endif;?>
</td>
<td>{$record.game_name}</td>
<td>{$record.sdk_version_text}</td>
<td>{$record.server_name}</td>
<td>{$record.role_num}</td>
<td>
<?php if($record['current_display'] == '' && $record['level'] < 4):?>
<a href="{:U('Query/promoteQuota', ['parent_id' => $record['id'], 'time' => $time])}">查看下级</a>
<?php endif;?>
<?php if($record['current_display'] != ''):?>
<a href="{:U('Query/quotaDtl', ['parent_id' => I('parent_id', 0), 'time' => $time, 'promote_id' => $record['id'], 'relation_game_id' => I('relation_game_id', ''), 'sdk_version' => I('sdk_version', ''), 'server_id' => I('server_id', ''), 'level_begin' => I('level_begin', ''), 'level_end' => I('level_end', ''), 'is_self' => 1])}">查看详情</a>
<?php else :?>
<a href="{:U('Query/quotaDtl', ['parent_id' => I('parent_id', 0), 'time' => $time, 'promote_id' => $record['id'], 'relation_game_id' => I('relation_game_id', ''), 'sdk_version' => I('sdk_version', ''), 'server_id' => I('server_id', ''), 'level_begin' => I('level_begin', ''), 'level_end' => I('level_end', ''), 'is_self' => 0])}">查看详情</a>
<?php endif;?>
</td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" href="{:U('download/promoteQuota_data_export',array_merge(['parent_id'=>$parentId,'time'=>$time],I('post.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$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>
<eq name='timeout' value='1'>
<script>
layer.msg('时间间隔不能超过7天');
</script>
</eq>
<script type="text/javascript">
$(function() {
var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({
mode: 'range',
locale: 'zh',
dateFormat: "Y-m-d",
defaultDate: defaultDate,
})
$('.select_gallery').select2()
var gameId = $('#game-select').val();
var sdkVersion = $('#sdk_version').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, sdkVersion, defaultServerId)
$('#game-select,#sdk_version').on({
change: function name() {
gameId = $('#game-select').val();
sdkVersion = $('#sdk_version').val();
getGameServers(gameId, sdkVersion, 0);
}
});
function getGameServers(gameId, sdkVersion, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId, sdk_version: sdkVersion},
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.server_id + '"' + selected + '>' + server.server_name + '</option>'
}
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
})
</script>
</block>

@ -0,0 +1,100 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
<link href="__STATIC__/icons_alibaba/iconfont.css?v=1.2" 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 style="position: absolute;margin-top: -25px;color: #6a7082;">
<span class="back-btn" style="cursor: pointer;"><i class="iconfont iconreply"></i> 返回</span>
</div>
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据管理></span><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 jssearch">
</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>角色名</th>
<th>等级</th>
<th>创建时间</th>
</tr>
<empty name="records">
<tr><td colspan="8" 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.user_account}</td>
<td>{$record.promote_account}</td>
<td>{$record.game_name}</td>
<td>{:getSDKTypeName($record['sdk_version'])}</td>
<td>{$record.server_name}</td>
<td>{$record.role_name}</td>
<td>{$record.role_level}</td>
<td>
<?php if($record['create_time'] == 0):?>
{$record.play_time|date='Y-m-d H:i:s',###}
<?php else:?>
{$record.create_time|date='Y-m-d H:i:s',###}
<?php endif;?>
</td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" data-href="{:U('download/quotaDtl_data_export',array_merge(['xlsname'=>'ceshi'],I('get.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$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" src="__JS__/common.js"></script>
<script type="text/javascript">
$(function() {
setValue('row', '{:I("get.row",10)}');
$('.back-btn').on('click', function () {
location.href = "{:U('Query/promoteQuota', ['parent_id' => I('parent_id'), 'time' => $time])}";
});
})
</script>
</block>
Loading…
Cancel
Save