Merge branch 'master' of 8.136.139.249:wmtx/platform into feature/finance_payment_20210115

master
chenzhi 4 years ago
commit 96f832322c

@ -649,18 +649,18 @@ class CompanyStatementController extends ThinkController
->select();
$use_data = [
"01"=>["time"=>"01","show_company_name"=>$data[0]["company_name"],"row"=>1],
"02"=>["time"=>"02","show_company_name"=>$data[0]["company_name"],"row"=>1],
"03"=>["time"=>"03","show_company_name"=>$data[0]["company_name"],"row"=>1],
"04"=>["time"=>"04","show_company_name"=>$data[0]["company_name"],"row"=>1],
"05"=>["time"=>"05","show_company_name"=>$data[0]["company_name"],"row"=>1],
"06"=>["time"=>"06","show_company_name"=>$data[0]["company_name"],"row"=>1],
"07"=>["time"=>"07","show_company_name"=>$data[0]["company_name"],"row"=>1],
"08"=>["time"=>"08","show_company_name"=>$data[0]["company_name"],"row"=>1],
"09"=>["time"=>"09","show_company_name"=>$data[0]["company_name"],"row"=>1],
"10"=>["time"=>"10","show_company_name"=>$data[0]["company_name"],"row"=>1],
"11"=>["time"=>"11","show_company_name"=>$data[0]["company_name"],"row"=>1],
"12"=>["time"=>"12","show_company_name"=>$data[0]["company_name"],"row"=>1],
"01"=>["time"=>"01","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.01.01','statement_end_time'=>$time.'.01.'.date('t',strtotime($time.'01'))]]],
"02"=>["time"=>"02","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.02.01','statement_end_time'=>$time.'.02.'.date('t',strtotime($time.'02'))]]],
"03"=>["time"=>"03","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.03.01','statement_end_time'=>$time.'.03.'.date('t',strtotime($time.'03'))]]],
"04"=>["time"=>"04","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.04.01','statement_end_time'=>$time.'.04.'.date('t',strtotime($time.'04'))]]],
"05"=>["time"=>"05","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.05.01','statement_end_time'=>$time.'.05.'.date('t',strtotime($time.'05'))]]],
"06"=>["time"=>"06","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.06.01','statement_end_time'=>$time.'.06.'.date('t',strtotime($time.'06'))]]],
"07"=>["time"=>"07","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.07.01','statement_end_time'=>$time.'.07.'.date('t',strtotime($time.'07'))]]],
"08"=>["time"=>"08","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.08.01','statement_end_time'=>$time.'.08.'.date('t',strtotime($time.'08'))]]],
"09"=>["time"=>"09","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.09.01','statement_end_time'=>$time.'.09.'.date('t',strtotime($time.'09'))]]],
"10"=>["time"=>"10","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.10.01','statement_end_time'=>$time.'.10.'.date('t',strtotime($time.'10'))]]],
"11"=>["time"=>"11","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.11.01','statement_end_time'=>$time.'.11.'.date('t',strtotime($time.'11'))]]],
"12"=>["time"=>"12","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.12.01','statement_end_time'=>$time.'.12.'.date('t',strtotime($time.'12'))]]],
];
$row = 0;
@ -681,8 +681,9 @@ class CompanyStatementController extends ThinkController
$real_statement_amount
= number_format($v['platform_money']*(1-$v['promote_ratio']/100)*($v['ratio']/100)*(1-$v["fax_ratio"]/100),2,'.','');;
$statement_info[$k]['other_amount'] = number_format($v["sum_money"] - $real_statement_amount,2,'.','');
if (!$statement_info[$k]['other_amount']) {
$statement_info[$k]['other_amount'] = number_format($v["sum_money"] - $real_statement_amount,2,'.','');
}
$sum[$ckey]["ratio"] += $v["ratio"];
$sum[$ckey]["promote_ratio"] += $v["promote_ratio"];
@ -725,10 +726,14 @@ class CompanyStatementController extends ThinkController
$assign_data[] = array_values($use_data);
}
// dump($assign_data);
foreach ($assign_data as $key => $value) {
foreach ($value as $k => $v) {
$assign_data[$key][$k]["row"] = count($v["statement_info"])?count($v["statement_info"]):1;
if (count($v["statement_info"]) > 1) {
unset($assign_data[$key][$k]['statement_info'][0]);
$assign_data[$key][$k]['statement_info'] = array_values($assign_data[$key][$k]['statement_info']);
}
$assign_data[$key][$k]["row"] = count($assign_data[$key][$k]["statement_info"])?count($assign_data[$key][$k]["statement_info"]):1;
}
}

@ -828,19 +828,23 @@ class MarketPercentageController extends ThinkController
$value['company_profit'] = "0.00";
}
//
$data[$key]['should_performance_commission'] = substr(number_format($value["performance_commission"] * ($market_percentage["performance_monthly_ratio"]/100), 4, '.', ''),0,-2)+$this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['performance_commission'];
$data[$key]['should_month_bonus_ratio'] = substr(number_format($value["achievement_bonus"] * ($market_percentage["month_bonus_ratio"]/100), 4, '.', ''),0,-2) + $this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['achievement_bonus'];
$data[$key]['should_performance_commission'] = number_format($value["performance_commission"] * ($market_percentage["performance_monthly_ratio"]/100), 2, '.', '')+$this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['performance_commission'];
$data[$key]['extend_commission'] += $this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['performance_commission']+$this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['achievement_bonus'];
$data[$key]['extend_commission'] = number_format($data[$key]['extend_commission'], 2, '.', '');
$data[$key]['should_month_bonus_ratio'] = $data[$key]['extend_commission'] - $data[$key]['should_performance_commission'];
// dump($this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['performance_commission']);
// dump($this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['achievement_bonus']);
// $data[$key]['wait_commission'] += $this->returnWaitMarketPercentageArray[$value['admin_id'].$value['pay_time']]['performance_commission']+$this->returnWaitMarketPercentageArray[$value['admin_id'].$value['pay_time']]['achievement_bonus'];
$data[$key]['extend_commission'] = number_format($data[$key]['extend_commission'], 2, '.', '');
$data[$key]['wait_commission'] = number_format($data[$key]['wait_commission'], 2, '.', '');
$data[$key]['wait_achievement_commission'] = $data[$key]['wait_commission'] - $data[$key]['wait_performance_commission'];
$data[$key]['achievement_bonus'] = $achievement_bonus;
$sum['performance_revenue'] += $data[$key]['performance_revenue'];

@ -71,14 +71,39 @@ class SocietyInfoController extends ThinkController
$map['communication_time'] = array('elt', time() - $gap * 86400);
}
if (I('sociaty_level') && I('sociaty_level') != '0') $map['sociaty_level'] = I('sociaty_level');
//获取分页数据
$query = $model->where($map)->order("communication_time desc");
$count = $query->count();
if($_REQUEST['ids'] && $is_export) {
$map['id'] = ['in',$_REQUEST['ids']];
}
$order_query = $query
->where($map);
if (I('data_order')) {
$data_order = reset(explode(',', $_REQUEST['data_order']));
$data_order_type = end(explode(',', $_REQUEST['data_order']));
if ($data_order == 4 && $data_order_type == "create_time") {
$order_query = $order_query->order("create_time desc");
} else if($data_order == 3 && $data_order_type == "create_time") {
$order_query = $order_query->order("create_time asc");
}
if ($data_order == 4 && $data_order_type == "communication_time") {
$order_query = $order_query->order("communication_time desc");
} else if($data_order == 3 && $data_order_type == "communication_time") {
$order_query = $order_query->order("communication_time asc");
}
$this->assign('userarpu_order', $data_order);
$this->assign('userarpu_order_type', $data_order_type);
}
if($is_export){
$map['id'] = ['in',$_REQUEST['ids']];
$parseData = $query->field("province, city, company_name, register_capital, functionary, phone, wechat, qq, game_type, game_name, join_platform, promote_scale,sociaty_level, turnover, address, league_info, is_potential, remark, interface_person, create_time, communication_time, create_account")
->where($map)
->order("communication_time desc")
$parseData = $order_query->field("province, city, company_name, register_capital, functionary, phone, wechat, qq, game_type, game_name, join_platform, promote_scale,sociaty_level, turnover, address, league_info, is_potential, remark, interface_person, create_time, communication_time, create_account")
->select();
foreach ($parseData as &$v) {
$v['sociaty_level'] = $this->level[$v['sociaty_level']];
@ -96,7 +121,7 @@ class SocietyInfoController extends ThinkController
$this->export($head, $parseData, "公会信息-".date('Ymd'));
return ;
} else {
$societyInfos = $model->where($map)->order("communication_time desc")->field("*")->page($page,$row)->select();
$societyInfos = $order_query->page($page,$row)->field("*")->select();
// dump($societyInfos);die();
}

@ -9,6 +9,7 @@ use Base\Service\TestingResourceService;
use Base\Service\PartnerService;
use Base\Repository\TestingResourceRepository;
use Base\Repository\GameRepository;
use Base\Service\GameService;
class TestingResourceController extends ThinkController
{
@ -439,11 +440,21 @@ class TestingResourceController extends ThinkController
$bindingRole = null;
if ($role) {
$servers = M('server', 'tab_')->field('id,server_name,server_id')->where(['game_id' => $role['game_id']])->order('server_id asc')->select();
$game = M('game', 'tab_')->where(['id' => $role['game_id']])->find(['id', 'data_share']);
$binding = M('testing_binding', 'tab_')->where(['game_id' => $role['game_id'], 'role_id' => $role['role_id']])->find();
if ($binding) {
$gameIds = [$role['game_id']];
if ($game['data_share'] == 1) {
$gameRepository = new GameRepository();
$baseGames = $gameRepository->getBaseGames();
$baseGame = $gameRepository->getBaseGameByGameId($role['game_id'], $baseGames);
$gameIds = $gameRepository->getGameIdsByBaseGame($baseGame);
}
$bindingRole = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'user_id', 'game_id', 'server_id', 'user_account', 'role_name'])
->where(['game_id' => $binding['game_id'], 'role_id' => $binding['bind_role_id']])
->where(['game_id' => ['in', $gameIds], 'role_id' => $binding['bind_role_id']])
->find();
if ($bindingRole) {
$bindingRole['binding_time'] = $binding['create_time'];
@ -574,34 +585,17 @@ class TestingResourceController extends ThinkController
$otherQuota = I('other_quota', 0);
$otherQuotaRemark = I('otherQuotaRemark', '');
M('user_play_info', 'tab_')->where(['id' => $id])->save(['testing_other_quota' => $otherQuota,'testing_other_quota_remark' => $otherQuotaRemark]);
$admin_account = $_SESSION['onethink_admin']['user_auth']['username'];
$otherQuotaRemark = !empty($otherQuotaRemark) ? $otherQuotaRemark : '无';
addOperationLog(array(
"op_type"=>1,
'op_name'=>'修改额外额度记录',
"key"=>'/'.$admin_account.'修改了额外额度'.$otherQuota.',备注信息为'.$otherQuotaRemark.'/',
"url"=>U("TestingResource/index")
));
return $this->ajaxReturn(['status' => 1, 'message' => '设置成功']);
}
public function getUserRoles()
{
$gameId = I('game_id', 0);
$serverId = I('server_id', 0);
$userAccount = I('user_account', '');
$server = M('server', 'tab_')->field(['id', 'server_name', 'server_id'])->where(['id' => $serverId])->find();
if (is_null($server)) {
return $this->ajaxReturn(['status' => 0, 'message' => '区服不存在']);
}
$user = M('user', 'tab_')->field(['id', 'promote_id'])->where(['account' => $userAccount])->find();
if (is_null($user)) {
return $this->ajaxReturn(['status' => 0, 'message' => '账号不存在']);
}
$testingUser = M('testing_user', 'tab_')->where(['user_account' => $userAccount])->find();
$isTestingAccount = is_null($testingUser) ? false : true;
$roles = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'role_name'])
->where(['user_account' => $userAccount, 'game_id' => $gameId, 'server_id' => $server['server_id']])
->select();
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['roles' => $roles, 'is_testing_account' => $isTestingAccount]]);
}
public function getResourceTypes()
{
$gameId = I('game_id', 0);
@ -759,4 +753,33 @@ class TestingResourceController extends ThinkController
return $this->ajaxReturn(['status' => 0, 'message' => $e->getMessage()]);
}
}
public function getUserRoles()
{
$gameId = I('game_id', 0);
$roleId = I('role_id', 0);
$game = M('game', 'tab_')->where(['id' => $gameId])->find();
if (is_null($game)) {
return $this->ajaxReturn(['status' => 0, 'message' => '游戏不存在']);
}
$gameIds = [$gameId];
if ($game['data_share'] == 1) {
$gameRepository = new GameRepository();
$baseGames = $gameRepository->getBaseGames();
$baseGame = $gameRepository->getBaseGameByGameId($gameId, $baseGames);
if (is_null($baseGame)) {
return $this->ajaxReturn(['status' => 0, 'message' => '游戏不存在']);
}
$gameIds = $gameRepository->getGameIdsByBaseGame($baseGame);
}
$roles = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'role_name'])
->where(['role_id' => $roleId, 'game_id' => ['in', $gameIds]])
->select();
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['roles' => $roles]]);
}
}

@ -380,7 +380,7 @@
<td>${it.aggregate_money}</td>
{@if it.statement_type==0}
<td><input type="text" class="txt statementchange" name="first_ratio" data-index ="${index}" data-change="statement_info[${index}]['first_ratio']" value="${it.first_ratio}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="ratio" data-index ="${index}" data-change="statement_info[${index}]['ratio']" value="${it.ratio}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="promote_ratio" data-index ="${index}" data-change="statement_info[${index}]['promote_ratio']" value="${it.promote_ratio}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="fax_ratio" data-index ="${index}" data-change="statement_info[${index}]['fax_ratio']" value="${it.fax_ratio}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange other_amount" name="other_amount" data-index ="${index}" data-change="statement_info[${index}]['other_amount']" value="${it.other_amount?it.other_amount:0}" style="width: 60px;"></td>
@ -529,7 +529,13 @@
var type = $(this).attr("name");
if(!CHECK.number.test(val)){
if(!CHECK.number.test(val)&&type!='other_amount'&&type!="sum_money"){
layer.msg('结算单中的罚款和税率必须是数字,且不能为空');
dom.val(vdata);
return false;
}
if(!CHECK.othernumber.test(val)&&(type=='other_amount'||type=="sum_money")){
layer.msg('结算单中的罚款和税率必须是数字,且不能为空');
dom.val(vdata);
return false;
@ -546,16 +552,16 @@
var index = $(this).data("index");
var td = DATAOBJ.statement_info[index];
if( $(this).attr("name") == "first_ratio"){
if( $(this).attr("name") == "ratio"){
td['second_ratio'] = 100-val;
}
if( $(this).attr("name") == "second_ratio"){
td['first_ratio'] = 100-val;
td['ratio'] = 100-val;
}
if(DATAOBJ.pay_type == 1){
//甲方收款
var ratio = td['first_ratio']/100;
var ratio = td['ratio']/100;
}else{
//乙方
var ratio = td['second_ratio']/100;
@ -580,6 +586,7 @@
}
var CHECK = {
number: /^\d+(\.{1}\d+)?$/,
othernumber: /^\-?\d+(\.{1}\d+)?$/,
mobile: /^1[3456789]\d{9}$/,
BankNo: /^([1-9]{1})\d{10,19}$/,
money: /((^[1-9]\d*)|^0)(\.\d{0,2}){0,1}$/

@ -126,9 +126,16 @@
<foreach name="first_data" item="datas">
<tr>
<td rowspan="{$datas['row']}">{$datas['show_company_name']}</td>
<td rowspan="{$datas['row']}">{$time}年{$datas["time"]}月</td>
<if condition="$datas['withdraw_type'] neq 0">
<td rowspan="{$datas['row']}">{$time}年{$datas["time"]}月</td>
</if>
<if condition="$datas['statement_info'][0]['statement_type'] gt 0">
<td>{$datas['statement_info'][0]['game_name']|default="--"}<if condition="$datas['statement_info'][0]['withdraw_type'] eq 0 and $datas['statement_info'][0]['statement_begin_time']">({$datas['statement_info'][0]['statement_begin_time']}-{$datas['statement_info'][0]['statement_end_time']})</if></td>
<if condition="$datas['withdraw_type'] eq 0">
<td>
{$datas['statement_info'][0]['statement_begin_time']}-{$datas['statement_info'][0]['statement_end_time']}
</td>
</if>
<td>{$datas['statement_info'][0]['game_name']|default="--"}</td>
<td>--</td>
<td>--</td>
<td>--</td>
@ -138,7 +145,12 @@
<td>--</td>
<td><if condition="$datas['statement_info'][0]['statement_type'] eq 2">-</if>{$datas['statement_info'][0]['sum_money']|default="--"}</td>
<else/>
<td>{$datas['statement_info'][0]['game_name']|default="--"}<if condition="$datas['statement_info'][0]['withdraw_type'] eq 0 and $datas['statement_info'][0]['statement_begin_time']">({$datas['statement_info'][0]['statement_begin_time']}-{$datas['statement_info'][0]['statement_end_time']})</if></td>
<if condition="$datas['withdraw_type'] eq 0">
<td>
{$datas['statement_info'][0]['statement_begin_time']}-{$datas['statement_info'][0]['statement_end_time']}
</td>
</if>
<td>{$datas['statement_info'][0]['game_name']|default="--"}</td>
<td>{$datas['statement_info'][0]['platform_money']|default="--"}</td>
<td>{$datas['statement_info'][0]['aggregate_money']|default="--"}</td>
<td>{$datas['statement_info'][0]['sum_amount']|default="--"}</td>
@ -154,7 +166,12 @@
<foreach name="datas['statement_info']" item="statement_info" key="skey">
<if condition="$skey gt 0">
<if condition="$statement_info['statement_type'] gt 0">
<td>{$statement_info['game_name']|default="--"}<if condition="$datas['statement_info'][0]['withdraw_type'] eq 0 and $statement_info['statement_begin_time']">({$statement_info['statement_begin_time']}-{$statement_info['statement_end_time']})</if></td>
<if condition="$datas['withdraw_type'] eq 0">
<td>
{$statement_info['statement_begin_time']}-{$statement_info['statement_end_time']}
</td>
</if>
<td>{$statement_info['game_name']|default="--"}</td>
<td>--</td>
<td>--</td>
<td>--</td>
@ -165,7 +182,12 @@
<td><if condition="$statement_info['statement_type'] eq 2">-</if>{$statement_info['sum_money']|default="--"}</td>
<else/>
<tr>
<td>{$statement_info['game_name']|default="--"}<if condition="$datas['statement_info'][0]['withdraw_type'] eq 0 and $statement_info['statement_begin_time']">({$statement_info['statement_begin_time']}-{$statement_info['statement_end_time']})</if></td>
<if condition="$datas['withdraw_type'] eq 0">
<td>
{$statement_info['statement_begin_time']}-{$statement_info['statement_end_time']}
</td>
</if>
<td>{$statement_info['game_name']|default="--"}</td>
<td>{$statement_info['platform_money']|default="--"}</td>
<td>{$statement_info['aggregate_money']|default="--"}</td>
<td>{$statement_info['sum_amount']|default="--"}</td>

@ -89,6 +89,8 @@
<input type="text" name="text" style="width: 200px" class="" placeholder="快速搜索" value="{:I('text')}"/>&nbsp;
</div>
<input type="hidden" name="sortBy" value="" class="sortBy">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('lists','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
@ -165,8 +167,28 @@
<th>是否为意向客户</th>
<th>备注信息</th>
<th>对接人</th>
<th>录入时间</th>
<th>最后沟通时间</th>
<th>
<a class="paixu" data-order='create_time'>
<if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'create_time'">
录入时间▲
<elseif
condition="$userarpu_order eq 3 and $userarpu_order_type eq 'create_time'" />
录入时间▼
<else />录入时间<img src="__IMG__/up-down.png" width="13px">
</if>
</a>
</th>
<th>
<a class="paixu" data-order='communication_time'>
<if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'communication_time'">
最后沟通时间▲
<elseif
condition="$userarpu_order eq 3 and $userarpu_order_type eq 'communication_time'" />
最后沟通时间▼
<else />最后沟通时间<img src="__IMG__/up-down.png" width="13px">
</if>
</a>
</th>
<th style="width:8%;min-width:10px;">操作</th>
</tr>
@ -429,6 +451,23 @@
return false;
});
$(".paixu").click(function () {
var that = $(this);
$data_order = that.attr('data-order');
$order_type = '{$userarpu_order}';
if ($order_type == '' || $order_type == '4') {
$(".sortBy").attr('name', 'data_order');
val = '3,' + $data_order;
$(".sortBy").attr('value', val);
$("#search").click();
} else if ($order_type == '3') {
$(".sortBy").attr('name', 'data_order');
val = '4,' + $data_order;
$(".sortBy").attr('value', val);
$("#search").click();
}
});
$("#excel_back").click(function () {
$(".search_list").show();
$(".excel_list").hide();

@ -264,9 +264,9 @@ body {
<div id="bind-box" class="layer-box" style="display: none;">
<form method="post" enctype="multipart/form-data">
<div class="form-group">
<label>玩家账号</label>
<label>角色ID</label>
<div class="form-item" style="width: 250px">
<input id="bind_account" name="account" type="text" class="form-input" style="width: 100%;">
<input id="bind_role_id" name="bind_role_id" type="text" class="form-input" style="width: 100%;">
</div>
</div>
<div class="form-group">
@ -535,48 +535,17 @@ body {
$('#verify-quota').html(verifyQuota)
$('#quota').html(quota-verifyQuota)
}
$('#test_account').on({
blur: function() {
var gameId = $('#game-select').val()
if (gameId == 0) {
return layer.msg('请选择游戏')
}
var serverId = $('#server-select').val()
if (serverId == 0) {
return layer.msg('请选择区服')
}
var userAccount = $('#test_account').val()
if (userAccount == '') {
return layer.msg('请输入测试资源账号')
}
getUserRoles(userAccount, gameId, serverId, function(roles, isTestingAccount) {
if (roles.length == 0) {
return layer.msg('当前账号在该区服未创建角色')
}
if (!isTestingAccount) {
return layer.msg('此账号非测试账号')
}
var html = "<option value=''>请选择角色</option>";
for (var i in roles){
html += "<option value='"+roles[i].role_id+"'>"+roles[i].role_name+"</option>"
}
$("#role-select").html(html);
$("#role-select").select2();
})
}
})
function getUserRoles(userAccount, gameId, serverId, callback) {
function getUserRoles(bindRoleId, gameId, callback) {
$.ajax({
url: "{:U('getUserRoles')}",
type: "post",
data: { user_account: userAccount, game_id: gameId, server_id: serverId },
data: { role_id: bindRoleId, game_id: gameId },
dataType: 'json',
success: function(result){
if (result.status == 1) {
var roles = result.data.roles
var isTestingAccount = result.data.is_testing_account
callback(roles, isTestingAccount)
callback(roles)
} else {
layer.msg(result.message)
}
@ -584,7 +553,7 @@ body {
})
}
$('#bind_account').on({
$('#bind_role_id').on({
blur: function () {
var gameId = $('#game-select').val()
if (gameId == 0) {
@ -594,16 +563,13 @@ body {
if (serverId == 0) {
return layer.msg('请选择区服')
}
var userAccount = $('#bind_account').val()
if (userAccount == '') {
return layer.msg('请输入玩家账号')
var bindRoleId = $('#bind_role_id').val()
if (bindRoleId == '') {
return layer.msg('请输入角色ID')
}
getUserRoles(userAccount, gameId, serverId, function(roles, isTestingAccount) {
getUserRoles(bindRoleId, gameId, function(roles) {
if (roles.length == 0) {
return layer.msg('玩家账号在该区服未创建角色')
}
if (isTestingAccount) {
return layer.msg('此账号为测试账号,无法绑定')
return layer.msg('未查询到角色')
}
var html = "<option value=''>请选择角色</option>";
for (var i in roles){

@ -2,6 +2,7 @@
namespace Base\Repository;
use Base\Service\GameService;
use Base\Tool\Registry;
use Base\Service\PromoteService;
@ -222,7 +223,7 @@ class TestingResourceRepository
'provide_status' => $batch['provide_status'],
'provide_status_text' => $this->getProvideStatusText($batch['provide_status']),
'provide_time' => $batch['provide_time'] == 0 ? '--' : date('Y-m-d H:i:s', $batch['provide_time']),
'content' => $content,
'content' => '',
];
}
return $records;
@ -317,6 +318,7 @@ class TestingResourceRepository
foreach ($roles as $role) {
$bindingOrWhere[] = '(role_id="' . $role['role_id'] . '" and game_id=' . $role['game_id'] . ')';
}
$bindingOrWhereStr = '(' . implode(' or ', $bindingOrWhere) . ')';
$userIds = array_unique(array_column($roles, 'user_id'));
$users = [];
@ -325,15 +327,30 @@ class TestingResourceRepository
$applyRecords = [];
$testingUsers = [];
if (count($roles) > 0) {
$games = M('game', 'tab_')->field(['id', 'data_share'])->where(['id' => ['in', array_column($roles, 'game_id')]])->select();
$games = index_by_column('id', $games);
$gameRepository = new GameRepository();
$baseGames = $gameRepository->getBaseGames();
$testingUsers = M('testing_user', 'tab_')->where(['user_id' => ['in', $userIds]])->select();
$testingUsers = index_by_column('user_id', $testingUsers);
$users = M('user', 'tab_')->field(['id', 'phone', 'lock_status'])->where(['id' => ['in', $userIds]])->select();
$users = index_by_column('id', $users);
$bindingRows = M('testing_binding', 'tab_')->where(['_string' => implode(' or ', $bindingOrWhere)])->select();
$bindingRows = M('testing_binding', 'tab_')->where(['_string' => $bindingOrWhereStr])->select();
$bindingRoleIds = [];
foreach ($bindingRows as $bindingRow) {
$bindings[$this->getGameRoleId($bindingRow['game_id'], $bindingRow['role_id'])] = $bindingRow;
$bindingRoleIds[] = $this->getGameRoleId($bindingRow['game_id'], $bindingRow['bind_role_id']);
$game = $games[$bindingRow['game_id']];
$gameIds = [$bindingRow['game_id']];
if ($game['data_share'] == 1) {
$baseGame = $gameRepository->getBaseGameByGameId($bindingRow['game_id'], $baseGames);
$gameIds = $gameRepository->getGameIdsByBaseGame($baseGame);
}
foreach ($gameIds as $gameId) {
$bindingRoleIds[] = $this->getGameRoleId($gameId, $bindingRow['bind_role_id']);
}
}
if (count($bindings) > 0) {
$bindingRoles = M('user_play_info', 'tab_')
@ -347,7 +364,7 @@ class TestingResourceRepository
->field('sum(apply_amount) amount, game_id, role_id')
->where([
'verify_status' => 0,
'_string' => implode(' or ', $bindingOrWhere)
'_string' => $bindingOrWhereStr,
])
->group('game_id,role_id')->select();
$verifyRecords = [];
@ -359,7 +376,7 @@ class TestingResourceRepository
->field('sum(provide_amount) amount, game_id, role_id')
->where([
'verify_status' => 1,
'_string' => implode(' or ', $bindingOrWhere)
'_string' => $bindingOrWhereStr,
])
->group('game_id,role_id')->select();
$provideRecords = [];
@ -371,9 +388,8 @@ class TestingResourceRepository
->field('sum(provide_amount) amount, game_id, role_id')
->where([
'verify_status' => 1,
'_string' => implode(' or ', $bindingOrWhere),
'provide_time' => ['egt', strtotime(date('Y-m-d 00:00:00'))],
'provide_time' => ['elt', strtotime(date('Y-m-d 23:59:59'))],
'_string' => $bindingOrWhereStr,
'provide_time' => ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]],
])
->group('game_id,role_id')->select();
$todayProvideRecords = [];
@ -384,7 +400,7 @@ class TestingResourceRepository
$applyItems = M('testing_resource_batch', 'tab_')
->field('sum(apply_amount) amount, game_id, role_id')
->where([
'_string' => implode(' or ', $bindingOrWhere),
'_string' => $bindingOrWhereStr,
])
->group('game_id,role_id')->select();
$applyRecords = [];
@ -466,11 +482,19 @@ class TestingResourceRepository
$testingUser = $testingUsers[$role['user_id']] ?? null;
$binding = $bindings[$role['game_role_id']] ?? null;
$bindingRole = null;
$baseGame = $gameRepository->getBaseGameByGameId($role['game_id'], $baseGames);
if ($binding) {
$bindGameRoleId = $this->getGameRoleId($binding['game_id'], $binding['bind_role_id']);
$bindingRole = $bindingRoles[$bindGameRoleId] ? $bindingRoles[$bindGameRoleId] : null;
$gameIds = $gameRepository->getGameIdsByBaseGame($baseGame);
foreach ($gameIds as $gameId) {
$bindGameRoleId = $this->getGameRoleId($gameId, $binding['bind_role_id']);
if (isset($bindingRoles[$bindGameRoleId])) {
$bindingRole = $bindingRoles[$bindGameRoleId];
break;
}
}
}
$baseGame = $gameRepository->getBaseGameByGameId($role['game_id'], $baseGames);
$gameSetting = null;
if ($baseGame && isset($gameSettings[$baseGame['id']])) {
$gameSetting = $gameSettings[$baseGame['id']];

@ -2,6 +2,7 @@
namespace Base\Service;
use Base\Facade\Request;
use Base\Repository\GameRepository;
use Base\Tool\GameResource;
use Base\Repository\TestingResourceRepository;
use Base\Repository\SpendRepository;
@ -167,17 +168,16 @@ class TestingResourceService
$spendRepository = new SpendRepository();
$spendMap = $spendRepository->withIsCheck($spendMap);
$spendQuota += M('spend', 'tab_')
$spendQuota = M('spend', 'tab_')
->where($spendMap)
->group('game_id,game_player_id')
->sum('pay_amount');
$totalQuota += round($gameSetting['rate'] / 100 * $spendQuota, 2);
}
$providedQuota = M('testing_resource_batch', 'tab_')
->where(['provide_status' => [in, [1, 2]], 'game_id' => $role['game_id'], 'role_id' => $role['role_id']])
->where(['provide_status' => ['in', [1, 2]], 'game_id' => $role['game_id'], 'role_id' => $role['role_id']])
->sum('provide_amount');
$providingQuota = M('testing_resource_batch', 'tab_')
->where(['verify_status' => [in, [0, 1]], 'provide_status' => 0, 'game_id' => $role['game_id'], 'role_id' => $role['role_id']])
->where(['verify_status' => ['in', [0, 1]], 'provide_status' => 0, 'game_id' => $role['game_id'], 'role_id' => $role['role_id']])
->sum('apply_amount');
return round(floatval($totalQuota) - floatval($providedQuota) - floatval($providingQuota), 2);
}
@ -300,9 +300,24 @@ class TestingResourceService
throw new \Exception('测试角色所属推广员异常');
}
$game = M('game', 'tab_')->where(['id' => $gameId])->find();
if (is_null($game)) {
throw new \Exception('游戏不存在');
}
$gameIds = [$gameId];
if ($game['data_share'] == 1) {
$gameRepository = new GameRepository();
$baseGames = $gameRepository->getBaseGames();
$baseGame = $gameRepository->getBaseGameByGameId($gameId, $baseGames);
if (is_null($baseGame)) {
throw new \Exception('游戏不存在');
}
$gameIds = $gameRepository->getGameIdsByBaseGame($baseGame);
}
$bindRole = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'user_id', 'promote_id'])
->where(['game_role_id' => $bindGameRoleId])
->where(['role_id' => $bindRoleId, 'game_id' => ['in', $gameIds]])
->find();
if (is_null($bindRole)) {
throw new \Exception('玩家角色不存在');
@ -426,9 +441,18 @@ class TestingResourceService
$bindingRole = null;
if ($binding) {
$gameRepository = new GameRepository();
$baseGames = $gameRepository->getBaseGames();
$gameIds = [$gameId];
if ($game['data_share'] == 1) {
$baseGame = $gameRepository->getBaseGameByGameId($gameId, $baseGames);
$gameIds = $gameRepository->getGameIdsByBaseGame($baseGame);
}
$bindingRole = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'user_id', 'promote_id', 'game_id'])
->where(['game_id' => $gameId, 'role_id' => $binding['bind_role_id']])
->where(['game_id' => ['in', $gameIds], 'role_id' => $binding['bind_role_id']])
->find();
if (is_null($bindingRole)) {
throw new \Exception('绑定玩家角色不存在');

@ -12,6 +12,7 @@ class BaseController extends HomeController
protected $loginPromote = null;
protected $canViewUserRecharge = true;
protected $permControlUrls = [
'Home/Query/recharge',
'Home/Players/playAction',

@ -2002,6 +2002,7 @@ class DownloadController extends BaseController
$serverId = I('server_id', 0);
$isSelf = I('is_self', 0);
$roleName = I('role_name', '');
$roleId = I('role_id', '');
$userAccount = I('user_account', '');
$promoteId = I('promote_id', 0);
$sdkVersion = I('sdk_version', 0);
@ -2036,6 +2037,9 @@ class DownloadController extends BaseController
if ($roleName != '') {
$map['role_name'] = ['like', '%' . $roleName . '%'];
}
if ($roleId != '') {
$map['role_id'] = $roleId;
}
if ($userAccount != '') {
$map['user_account'] = ['like', '%' . $userAccount . '%'];
}
@ -2063,7 +2067,7 @@ class DownloadController extends BaseController
$map['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
}
if ($isSelf) {
$map['promote_id'] = $queryPromote['id'];
$map['role.promote_id'] = $queryPromote['id'];
}
$orderBy = 'create_time desc';
@ -3120,6 +3124,7 @@ public function iosDetailExcelInfo($id,$map) {
array('device_number','设备码'),
array('register_time','注册时间'),
array('register_ip','注册IP'),
array('role_id','角色ID'),
array('login_time','最近登录时间'),
array('login_ip','最近登录IP'),
@ -3144,6 +3149,7 @@ public function iosDetailExcelInfo($id,$map) {
'role.server_name',
'role.sdk_version',
'role.role_name',
'role.role_id',
'role.role_level',
'role.create_time',
'role.play_time',

@ -307,9 +307,9 @@ class HomeController extends Controller
$ssgUrl = $downloadDomain . '/mobile.php/Ssg/pay/game_id/' . $game['id'] . '/promote_id/' . $promoteId;
/* if(in_array($game['id'], [187, 188])) {
$game['relation_game_name'] = '游戏下载';
} */
if(in_array($game['id'], [191, 192])) {
$game['relation_game_name'] = '九灵神域';
}
$this->assign("serviceQQ", $serviceQQ);
$this->assign('isNewIos', $isNewIos);

@ -1352,7 +1352,7 @@ class PromoteController extends BaseController
// if (!preg_match($pattern, $_REQUEST['email'])) {
// $this->error('您输入的电子邮箱地址不合法', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0))));
// };
$_POST['ts_over_apply'] = $_POST['ts_over_manage'];
$user = new PromoteApi();
$res = $user->edit($_POST);

@ -1705,6 +1705,7 @@ class QueryController extends BaseController
$serverId = I('server_id', 0);
$isSelf = I('is_self', 0);
$roleName = I('role_name', '');
$roleId = I('role_id', '');
$userAccount = I('user_account', '');
$promoteId = I('promote_id', 0);
$sdkVersion = I('sdk_version', 0);
@ -1736,6 +1737,8 @@ class QueryController extends BaseController
}
if ($roleName != '') {
$map['role_name'] = ['like', '%' . $roleName . '%'];
}if ($roleId != '') {
$map['role_id'] = $roleId;
}
if ($userAccount != '') {
$map['user_account'] = ['like', '%' . $userAccount . '%'];
@ -1761,9 +1764,11 @@ class QueryController extends BaseController
$map['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
}
if ($isSelf) {
$map['promote_id'] = $queryPromote['id'];
$map['role.promote_id'] = $queryPromote['id'];
}
$orderBy = 'create_time desc';
$sortNameData = ['login_time', 'create_time', 'role_level', 'register_time', 'role.promote_account'];
if (!empty($sortName)) {
@ -1792,12 +1797,12 @@ class QueryController extends BaseController
'role.server_name',
'role.sdk_version',
'role.role_name',
'role.role_id',
'role.role_level',
'role.create_time',
'role.play_time',
'role.play_ip'
];
$query = M('user_play_info', 'tab_')
->field($columns)
->alias('role')
@ -1809,11 +1814,14 @@ class QueryController extends BaseController
list($records, $pagination, $count) = $this->paginate($query->order($orderBy));
$countRow = $countQuery->field(['count(distinct user_id) user_count'])->find();
$subSql = M('user', 'tab_')->field('id')->where(['is_repeat' => 0])->select(false);
$map['_string'] = str_replace('role.promote_id', 'promote_id', $map['_string']) . ' and user_id in (' . $subSql . ')';
$map['promote_id'] = $map['role.promote_id'];
unset($map['role.promote_id']);
$uniqueCountRow = M('user_play_info', 'tab_')->field(['count(distinct user_id) user_count, count(*) count'])->where($map)->find();
/* $users = [];
if (count($records) > 0) {
$userIds = array_column($records, 'user_id');
@ -1836,7 +1844,7 @@ class QueryController extends BaseController
$hideChar .= '*';
}
if($record['create_time'] == 0) {
if($records[$key]['create_time'] == 0) {
$records[$key]['create_time'] = date('Y-m-d', $value['play_time']) . '<br>' . date('H:i:s', $value['play_time']);
} else {
$records[$key]['create_time'] = date('Y-m-d', $value['create_time']) . '<br>' . date('H:i:s', $value['create_time']);

@ -10,6 +10,7 @@ use Think\Model;
use Base\Service\TestingResourceService;
use Base\Repository\TestingResourceRepository;
use Base\Repository\GameRepository;
use Base\Service\GameService;
class TestingResourceController extends BaseController
{
@ -135,11 +136,21 @@ class TestingResourceController extends BaseController
$bindingRole = null;
if ($role) {
$servers = M('server', 'tab_')->field('id,server_name,server_id')->where(['game_id' => $role['game_id']])->order('server_id asc')->select();
$game = M('game', 'tab_')->where(['id' => $role['game_id']])->find(['id', 'data_share']);
$binding = M('testing_binding', 'tab_')->where(['game_id' => $role['game_id'], 'role_id' => $role['role_id']])->find();
if ($binding) {
$gameIds = [$role['game_id']];
if ($game['data_share'] == 1) {
$gameRepository = new GameRepository();
$baseGames = $gameRepository->getBaseGames();
$baseGame = $gameRepository->getBaseGameByGameId($role['game_id'], $baseGames);
$gameIds = $gameRepository->getGameIdsByBaseGame($baseGame);
}
$bindingRole = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'user_id', 'game_id', 'server_id', 'user_account', 'role_name'])
->where(['game_id' => $binding['game_id'], 'role_id' => $binding['bind_role_id']])
->where(['game_id' => ['in', $gameIds], 'role_id' => $binding['bind_role_id']])
->find();
if ($bindingRole) {
$bindingRole['binding_time'] = $binding['create_time'];
@ -230,25 +241,29 @@ class TestingResourceController extends BaseController
public function getUserRoles()
{
$gameId = I('game_id', 0);
$serverId = I('server_id', 0);
$userAccount = I('user_account', '');
$server = M('server', 'tab_')->field(['id', 'server_name', 'server_id'])->where(['id' => $serverId])->find();
if (is_null($server)) {
return $this->ajaxReturn(['status' => 0, 'message' => '区服不存在']);
}
$roleId = I('role_id', 0);
$user = M('user', 'tab_')->field(['id', 'promote_id'])->where(['account' => $userAccount])->find();
if (is_null($user)) {
return $this->ajaxReturn(['status' => 0, 'message' => '账号不存在']);
$game = M('game', 'tab_')->where(['id' => $gameId])->find();
if (is_null($game)) {
return $this->ajaxReturn(['status' => 0, 'message' => '游戏不存在']);
}
$testingUser = M('testing_user', 'tab_')->where(['user_account' => $userAccount])->find();
$isTestingAccount = is_null($testingUser) ? false : true;
$gameIds = [$gameId];
if ($game['data_share'] == 1) {
$gameRepository = new GameRepository();
$baseGames = $gameRepository->getBaseGames();
$baseGame = $gameRepository->getBaseGameByGameId($gameId, $baseGames);
if (is_null($baseGame)) {
return $this->ajaxReturn(['status' => 0, 'message' => '游戏不存在']);
}
$gameIds = $gameRepository->getGameIdsByBaseGame($baseGame);
}
$roles = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'role_name'])
->where(['user_account' => $userAccount, 'game_id' => $gameId, 'server_id' => $server['server_id']])
->where(['role_id' => $roleId, 'game_id' => ['in', $gameIds]])
->select();
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['roles' => $roles, 'is_testing_account' => $isTestingAccount]]);
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['roles' => $roles]]);
}
}

@ -79,6 +79,19 @@
</td>
</tr>
<?php endif;?>
<tr>
<td class="l">测试资源管理权限:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label style="margin-right: 15px" >
<input type="radio" value="1" name="ts_over_manage" class="withdraw_done" <if condition="$data['ts_over_manage'] eq 1">checked="checked"</if>> 开启
</label >
<label >
<input type="radio" value="0" name="ts_over_manage" class="withdraw_done" <if condition="$data['ts_over_manage'] eq 0">checked="checked"</if>> 关闭
</label>
</span>
</td>
</tr>
<tr>
<td class="l"></td>
<td class="r">

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

@ -74,6 +74,9 @@
<label> ~ </label>
<input type="text" class="txt integer-input" name="role_level_end" style="width: 50px" value="{:I('role_level_end')}" >
</div>
<div class="form-group normal_space">
<input type="text" name="role_id" class="txt normal_txt" id="uid" placeholder="请输入角色ID" value="{:I('role_id')}">
</div>
<div class="form-group normal_space">
<input type="hidden" name="last_sort_name" id="last_sort_name" value="{:I('sort_name', '')}">
<input type="hidden" name="sort_name" id="sort_name" value="{:I('sort_name', '')}">
@ -115,6 +118,7 @@
</if>
</th>
<th>注册IP</th>
<th>角色ID</th>
<th class="sort" sort-name="login_time" class="title-cursor-pointer">最近登录时间
<if condition="'login_time' == I('sort_name', '')">
<if condition="1 == $sort">
@ -166,6 +170,7 @@
<td>{$record.device_number}</td>
<td>{$record.register_time}</td>
<td>{$record.register_ip}</td>
<td>{$record.role_id}</td>
<td>{$record.login_time}</td>
<td>{$record.login_ip}</td>

@ -216,9 +216,9 @@
<div id="bind-box" class="layer-box" style="display: none;">
<form method="post" enctype="multipart/form-data">
<div class="form-group">
<label>玩家账号</label>
<label>角色ID</label>
<div class="form-item" style="width: 250px">
<input id="bind_account" name="account" type="text" class="form-input" style="width: 100%;">
<input id="bind_role_id" name="bind_role_id" type="text" class="form-input" style="width: 100%;">
</div>
</div>
<div class="form-group">
@ -488,7 +488,7 @@
$('#verify-quota').html(verifyQuota)
$('#quota').html(quota-verifyQuota)
}
$('#test_account').on({
/* $('#test_account').on({
blur: function() {
var gameId = $('#game-select').val()
if (gameId == 0) {
@ -517,19 +517,18 @@
$("#role-select").select2();
})
}
})
}) */
function getUserRoles(userAccount, gameId, serverId, callback) {
function getUserRoles(bindRoleId, gameId, callback) {
$.ajax({
url: "{:U('getUserRoles')}",
type: "post",
data: { user_account: userAccount, game_id: gameId, server_id: serverId },
data: { role_id: bindRoleId, game_id: gameId },
dataType: 'json',
success: function(result){
if (result.status == 1) {
var roles = result.data.roles
var isTestingAccount = result.data.is_testing_account
callback(roles, isTestingAccount)
callback(roles)
} else {
layer.msg(result.message)
}
@ -537,26 +536,19 @@
})
}
$('#bind_account').on({
$('#bind_role_id').on({
blur: function () {
var gameId = $('#game-select').val()
if (gameId == 0) {
return layer.msg('请选择游戏')
}
var serverId = $('#server-select').val()
if (serverId == 0) {
return layer.msg('请选择区服')
}
var userAccount = $('#bind_account').val()
if (userAccount == '') {
return layer.msg('请输入玩家账号')
var bindRoleId = $('#bind_role_id').val()
if (bindRoleId == '') {
return layer.msg('请输入角色ID')
}
getUserRoles(userAccount, gameId, serverId, function(roles, isTestingAccount) {
getUserRoles(bindRoleId, gameId, function(roles) {
if (roles.length == 0) {
return layer.msg('玩家账号在该区服未创建角色')
}
if (isTestingAccount) {
return layer.msg('此账号为测试账号,无法绑定')
return layer.msg('未查询到角色')
}
var html = "<option value=''>请选择角色</option>";
for (var i in roles){

@ -84,7 +84,7 @@
<select id="server_id" name="server_id" class="reselect select_gallery" style="width:101px">
<option server-id="0" value="">请选择区服</option>
<?php foreach($servers as $server):?>
<option server-id="<?=$server['server_id']?>" value="<?=$server['server_id']?>" <?php if($server['server_id'] == I('server_id')):?>selected="selected"<?php endif;?>>
<option server-id="<?=$server['server_id']?>" value="<?=$server['id']?>" <?php if($server['id'] == I('server_id')):?>selected="selected"<?php endif;?>>
<?=$server['server_name']?>
</option>
<?php endforeach;?>
@ -280,7 +280,7 @@ $("#submit").click(function(){
var servers = result.data.servers
var str = "<option value=''>请选择区服</option>"
for (var i in servers){
str += "<option value='"+servers[i].server_name+"'>"+servers[i].server_name+"</option>"
str += "<option value='"+servers[i].id+"'>"+servers[i].server_name+"</option>"
}
$("#server_id").empty()
$("#server_id").append(str)

Loading…
Cancel
Save