master
elf@home 5 years ago
parent ecf460e7c9
commit 461f347b1a

@ -135,6 +135,8 @@ class TestingResourceController extends BaseController
]; ];
} }
$this->assign('games', $this->getGames());
$this->assign('servers', $this->getServersByGameId($gameId));
$this->assign('count', $count); $this->assign('count', $count);
$this->assign('pagination', $pagination); $this->assign('pagination', $pagination);
$this->assign('records', $records); $this->assign('records', $records);
@ -193,10 +195,10 @@ class TestingResourceController extends BaseController
public function batches() public function batches()
{ {
$verifyTimeStart = I('verify_time_start', ''); $provideTimeStart = I('provide_time_start', '');
$verifyTimeEnd = I('verify_time_end', ''); $provideTimeEnd = I('provide_time_end', '');
$verifyStatus = I('verify_status', -1); $verifyStatus = I('verify_status', -1);
$status = I('status', -1); $provideStatus = I('provide_status', -1);
$account = I('account'); $account = I('account');
$loginPromote = $this->getLoginPromote(); $loginPromote = $this->getLoginPromote();
@ -209,17 +211,17 @@ class TestingResourceController extends BaseController
$conditions = [ $conditions = [
'_string' => 'exists (' . $subSql . ')' '_string' => 'exists (' . $subSql . ')'
]; ];
if ($verifyTimeStart) { if ($provideTimeStart) {
$conditions['verify_time'] = ['egt', strtotime($verifyTimeStart . ' 00:00:00')]; $conditions['provide_time'] = ['egt', strtotime($provideTimeStart . ' 00:00:00')];
} }
if ($verifyTimeEnd) { if ($provideTimeEnd) {
$conditions['verify_time'] = ['elt', strtotime($verifyTimeEnd . ' 23:59:59')]; $conditions['provide_time'] = ['elt', strtotime($provideTimeEnd . ' 23:59:59')];
} }
if ($verifyStatus != -1) { if ($verifyStatus != -1) {
$conditions['verify_status'] = $verifyStatus; $conditions['verify_status'] = $verifyStatus;
} }
if ($status != -1) { if ($provideStatus != -1) {
$conditions['status'] = $status; $conditions['provide_status'] = $provideStatus;
} }
if ($account) { if ($account) {
$user = M('user', 'tab_')->field(['id'])->where('account like ' . $account . '%')->find(); $user = M('user', 'tab_')->field(['id'])->where('account like ' . $account . '%')->find();
@ -259,6 +261,18 @@ class TestingResourceController extends BaseController
} }
} }
$provideStatusList = [
'0' => '待发放',
'1' => '已发放',
'2' => '拒绝',
'3' => '异常',
];
$verifyStatusList = [
'0' => '未审核',
'1' => '审核通过',
'2' => '审核拒绝',
];
$records = []; $records = [];
foreach ($batches as $batch) { foreach ($batches as $batch) {
$roleKey = $this->getGameRoleId($batch['game_id'], $batch['role_id']); $roleKey = $this->getGameRoleId($batch['game_id'], $batch['role_id']);
@ -280,15 +294,19 @@ class TestingResourceController extends BaseController
'history_provide_amount' => 0.00, 'history_provide_amount' => 0.00,
'apply_amount' => $batch['apply_amount'], 'apply_amount' => $batch['apply_amount'],
'provide_amount' => $batch['provide_amount'], 'provide_amount' => $batch['provide_amount'],
'verify_status_text' => $batch['verify_status'], 'verify_status' => $batch['verify_status'],
'verify_time' => date('Y-m-d H:i:s', $batch['verify_time']), 'verify_status_text' => $verifyStatusList[$batch['verify_status']],
'status_text' => $batch['status'], 'verify_time' => $batch['verify_time'] == 0 ? '--' : date('Y-m-d H:i:s', $batch['verify_time']),
'provide_status_text' => $batch['provide_status'], 'provide_status' => $batch['provide_status'],
'provide_time' => date('Y-m-d H:i:s', $batch['provide_time']), 'provide_status_text' => $provideStatusList[$batch['provide_status']],
'provide_time' => $batch['provide_time'] == 0 ? '--' : date('Y-m-d H:i:s', $batch['provide_time']),
'content' => $content, 'content' => $content,
]; ];
} }
$this->assign('provideStatusList', $provideStatusList);
$this->assign('servers', $this->getServersByGameId($gameId));
$this->assign('games', $this->getGames());
$this->assign('count', $count); $this->assign('count', $count);
$this->assign('pagination', $pagination); $this->assign('pagination', $pagination);
$this->assign('records', $records); $this->assign('records', $records);
@ -297,14 +315,53 @@ class TestingResourceController extends BaseController
public function orders() public function orders()
{ {
$batchId = I('batch_id', 0); $id = I('id', 0);
$batch = M('testing_resource_batch', 'tab_')->where(['id' => $id])->find();
$role = M('user_play_info', 'tab_')
->field(['id', 'game_name', 'server_name', 'role_name', 'game_role_id', 'user_account'])
->where(['game_id' => $batch['game_id'], 'role_id' => $batch['role_id']])
->find();
$applyPromote = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => $batch['apply_promote_id']])->find();
$promote = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => $role['apply_promote_id']])->find();
$query = M('testing_resource_order', 'tab_')->where(['batch_id' => $batchId])->order('create_time desc')->select(); $query = M('testing_resource_order', 'tab_')->where(['batch_id' => $id])->order('id desc');
list($orders, $pagination, $count) = $this->paginate($query); list($orders, $pagination, $count) = $this->paginate($query);
/** $provideStatusList = [
* @todo '0' => '待发放',
*/ '1' => '已发放',
'2' => '拒绝',
'3' => '异常',
];
$verifyStatusList = [
'0' => '未审核',
'1' => '审核通过',
'2' => '审核拒绝',
];
foreach ($orders as $order) {
$records[] = [
'id' => $order['id'],
'create_time' => $batch['create_time'] == 0 ? '--' : date('Y-m-d H:i:s', $batch['create_time']),
'game_name' => $role['game_name'],
'user_account' => $role['user_account'],
'server_name' => $role['server_name'],
'role_name' => $role['role_name'],
'apply_promote_account' => $applyPromote ? $applyPromote['account'] : '',
'promote_account' => $promote['account'],
'ref_name' => $order['ref_name'],
'ref_amount' => $order['ref_amount'],
'num' => $order['num'],
'amount' => $order['num'] * $order['ref_amount'],
'remark' => $order['remark'],
'verify_status' => $batch['provide_status'],
'verify_status_text' => $verifyStatusList[$batch['verify_status']],
'provide_status' => $batch['provide_status'],
'provide_status_text' => $provideStatusList[$batch['provide_status']],
];
}
$this->assign('count', $count); $this->assign('count', $count);
$this->assign('pagination', $pagination); $this->assign('pagination', $pagination);
@ -474,6 +531,7 @@ class TestingResourceController extends BaseController
'order_no' => $orderNo, 'order_no' => $orderNo,
'ref_id' => $record['resource_id'], 'ref_id' => $record['resource_id'],
'ref_name' => $record['resource_name'], 'ref_name' => $record['resource_name'],
'ref_amount' => $record['value'],
'num' => $record['num'], 'num' => $record['num'],
'amount' => $record['num'] * $record['value'], 'amount' => $record['num'] * $record['value'],
'remark' => $record['remark'], 'remark' => $record['remark'],
@ -561,16 +619,32 @@ class TestingResourceController extends BaseController
return $this->ajaxReturn(['status' => 1, 'message' => '绑定成功']); return $this->ajaxReturn(['status' => 1, 'message' => '绑定成功']);
} }
public function getServers() private function getGames()
{ {
$gameId = I('game_id', 0); $map = [
'id' => ['in', [229, 230]]
];
return M('game', 'tab_')->field('id,game_name')->where($map)->select();
}
private function getServersByGameId($gameId = 0)
{
if ($gameId == 0) {
return [];
}
$map = []; $map = [];
$map['game_id'] = $gameId; $map['game_id'] = $gameId;
$servers = M('server', 'tab_') return M('server', 'tab_')
->field('id,server_name,server_id') ->field('id,server_name,server_id')
->where($map) ->where($map)
->order('server_id asc') ->order('server_id asc')
->select(); ->select();
}
public function getServers()
{
$gameId = I('game_id', 0);
$servers = $this->getServersByGameId($gameId);
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['servers' => $servers]]); return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['servers' => $servers]]);
} }
@ -658,9 +732,4 @@ class TestingResourceController extends BaseController
} }
return $resources; return $resources;
} }
private function getRemainAmount($user)
{
}
} }

@ -547,13 +547,9 @@
dataType: 'json', dataType: 'json',
success: function(result){ success: function(result){
if (result.status == 1) { if (result.status == 1) {
var servers = result.data.servers layer.msg(result.message, function(){
var html = "<option value=''>请选择区服</option>"; parent.window.location.href = parent.window.location.href
for (var i in servers) { })
html += "<option value='"+servers[i].server_id+"'>"+servers[i].server_name+"</option>"
}
$("#server-select").html(html);
$("#server-select").select2();
} else { } else {
layer.msg(result.message) layer.msg(result.message)
} }

@ -40,51 +40,56 @@
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<input type="submit" class="submit" id='submit' value="查询" url="{:U('lists',['type'=>I('type')])}" style="cursor:pointer;"> <input type="submit" class="submit" id='submit' value="查询" url="{:U('lists',['type'=>I('type')])}" style="cursor:pointer;">
</div> </div>
<div class="form-group normal_space fr">
<select name="provide_status" class="reselect select_gallery">
<option status-id="0" value="">请选择发放状态</option>
<?php foreach($provideStatusList as $key => $name):?>
<option status-id="<?=key?>" value="<?=$key?>" <?php if($key === I('provide_status')):?>selected="selected"<?php endif;?>>
<?=$name?>
</option>
<?php endforeach;?>
</select>
</div>
<div class="form-group normal_space fr" style="margin-left: 9px;"> <div class="form-group normal_space fr" style="margin-left: 9px;">
<label class="form-title select-title" style="margin-right: 9px;"></label> <label class="form-title select-title" style="margin-right: 9px;"></label>
<div class="select-time"> <div class="select-time">
<input type="text" id="edate" class="txt" name="end" placeholder="结束时间" value="{:I('end')}" autocomplete="off"> <input type="text" id="edate" class="txt" name="provide_time_end" placeholder="结束时间" value="{:I('provide_time_end')}" autocomplete="off">
</div> </div>
</div> </div>
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<label class="form-title select-title">申请时间:</label> <label class="form-title select-title">申请时间:</label>
<div class="select-time"> <div class="select-time">
<input type="text" id="sdate" class="txt" name="start" placeholder="开始时间" value="{:I('start')}" autocomplete="off"> <input type="text" id="sdate" class="txt" name="provide_time_start" placeholder="开始时间" value="{:I('provide_time_start')}" autocomplete="off">
</div> </div>
</div> </div>
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<input type="text" name="user_account" class="txt normal_txt" id="uid" style="width:110px;" placeholder="请输入玩家账号" value="{:I('user_account')}" onKeyDown="webchat_chkkeysend(event);"> <input type="text" name="user_account" class="txt normal_txt" id="uid" style="width:110px;" placeholder="请输入玩家账号" value="{:I('account')}" onKeyDown="webchat_chkkeysend(event);">
</div> </div>
<div class="form-group normal_space fr">
<input type="text" name="role_name" class="txt normal_txt" style="width:110px;" placeholder="角色名" value="{:I('role_name')}" onKeyDown="webchat_chkkeysend(event);">
</div>
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<span id="server_js"> <span id="server_js">
<select id="server_id" name="server_name" class="reselect select_gallery" style="width:101px"> <select id="server_id" name="server_id" class="reselect select_gallery" style="width:101px">
<option game-id="0" value="">请选择区服</option> <option server-id="0" value="">请选择区服</option>
<volist name=":getServer_name_on($_GET['game_name'])" id="vo"> <?php foreach($servers as $server):?>
<option value="{$vo.server_name}" <if condition="$_GET['server_name'] eq $vo['server_name']">selected="selected"</if>>{$vo.server_name}</option> <option server-id="<?=$server['server_id']?>" value="<?=$server['server_id']?>" <?php if($server['server_id'] == I('server_id')):?>selected="selected"<?php endif;?>>
</volist> <?=$server['server_name']?>
</option>
<?php endforeach;?>
</select> </select>
</span> </span>
</div> </div>
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<select id="game_id" name="game_name" class="reselect select_gallery" > <select id="game_id" name="game_id" class="reselect select_gallery" >
<option game-id="0" value="">请选择游戏</option> <option game-id="0" value="">请选择游戏</option>
<volist name=":get_game_list()" id="vo"> <?php foreach($games as $game):?>
<option game-id="{$vo.id}" value="{$vo.game_name}" <if condition="$_GET['game_name'] eq $vo['game_name']">selected="selected"</if>>{$vo.game_name}</option> <option game-id="<?=$game['id']?>" value="<?=$game['id']?>" <?php if($game['id'] == I('game_id')):?>selected="selected"<?php endif;?>>
</volist> <?=$game['game_name']?>
</option>
<?php endforeach;?>
</select> </select>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -102,7 +107,7 @@
<th>测试账号</th> <th>测试账号</th>
<th>手机号</th> <th>手机号</th>
<th>所属推广员</th> <th>所属推广员</th>
<th>申请人</th> <th>申请人</th>
<th>发放总金额</th> <th>发放总金额</th>
<th>申请金额</th> <th>申请金额</th>
<th>发放金额</th> <th>发放金额</th>
@ -192,6 +197,22 @@ $().ready(function(){
formatDate:'Y-m-d', formatDate:'Y-m-d',
timepicker:false timepicker:false
}); });
$('.view-detail').on({
click:function () {
var url = "{:U('TestingResource/orders', '', '')}"
var id = $(this).parents('tr').eq(0).attr('data-id')
url += '/id/' + id
layer.open({
title: '查看申请订单',
type: 2,
content: [url , 'no'],
area: ['1200px', '400px'],
zIndex: 250,
scrollbar: false,
})
}
})
}); });
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
@ -234,52 +255,27 @@ $("#submit").click(function(){
$("#game_id").change(function(){ $("#game_id").change(function(){
$.ajax({
$.ajax({ url: "{:U('getServers')}",
type: "post",
url:"{:U('getServer')}", data: {game_id:$("#game_id option:selected").attr('game-id')},
dataType: 'json',
type:"post", success: function(result) {
if (result.status == 1) {
data:{game_id:$("#game_id option:selected").attr('game-id')}, var servers = result.data.servers
var str = "<option value=''>请选择区服</option>"
dataType:'json', for (var i in servers){
str += "<option value='"+servers[i].server_name+"'>"+servers[i].server_name+"</option>"
success:function(data){ }
console.log(data); $("#server_id").empty()
str = "<option value=''>请选择区服</option>"; $("#server_id").append(str)
$("#server_id").select2()
for (var i in data){
str += "<option value='"+data[i].server_name+"'>"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
})
$("#server_js").click(function(event) {
var game_id=$("#game_id").val();
if(game_id==0){
layer.msg('请先选择游戏');
} }
}); }
})
})
function webchat_chkkeysend(event) function webchat_chkkeysend(event)
{ {
if (event.keyCode==13) { if (event.keyCode==13) {

@ -128,30 +128,26 @@
</div> </div>
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<span id="server_js"> <span id="server_js">
<select id="server_id" name="server_name" class="reselect select_gallery" <select id="server_id" name="server_id" class="reselect select_gallery" style="width:101px" data-default="<?=I('server_id', '')?>">
style="width:101px"> <option server-id="0" value="">请选择区服</option>
<option game-id="0" value="">请选择区服</option> <?php foreach($servers as $server):?>
<volist name=":getServer_name_on($_GET['game_name'])" id="vo"> <option server-id="<?=$server['server_id']?>" value="<?=$server['server_id']?>" <?php if($server['server_id'] == I('server_id')):?>selected="selected"<?php endif;?>>
<option value="{$vo.server_name}" <if <?=$server['server_name']?>
condition="$_GET['server_name'] eq $vo['server_name']">selected="selected"</if> </option>
>{$vo.server_name}</option> <?php endforeach;?>
</volist>
</select> </select>
</span> </span>
</div> </div>
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<select id="game_id" name="game_name" class="reselect select_gallery"> <select id="game_id" name="game_id" class="reselect select_gallery">
<option game-id="0" value="">请选择游戏</option> <option game-id="0" value="">请选择游戏</option>
<volist name=":get_game_list()" id="vo"> <?php foreach($games as $game):?>
<option game-id="{$vo.id}" value="{$vo.game_name}" <if <option game-id="<?=$game['id']?>" value="<?=$game['id']?>" <?php if($game['id'] == I('game_id')):?>selected="selected"<?php endif;?>>
condition="$_GET['game_name'] eq $vo['game_name']">selected="selected"</if> <?=$game['game_name']?>
>{$vo.game_name}</option> </option>
</volist> <?php endforeach;?>
</select> </select>
</div> </div>
<br> <br>
<br> <br>
<br> <br>
@ -165,12 +161,7 @@
style="width: 100px;text-align: center;background:rgb(249,104,104);cursor:pointer;" style="width: 100px;text-align: center;background:rgb(249,104,104);cursor:pointer;"
value="新增测试号" url="{:U('add')}"> value="新增测试号" url="{:U('add')}">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -461,49 +452,31 @@
}); });
$("#game_id").change(function () { $("#game_id").change(function () {
$.ajax({ $.ajax({
url: "{:U('getServers')}",
url: "{:U('getServer')}",
type: "post", type: "post",
data: { game_id: $("#game_id option:selected").attr('game-id') }, data: { game_id: $("#game_id option:selected").attr('game-id') },
dataType: 'json', dataType: 'json',
success: function (result ) {
success: function (data) { if (result.status == 1) {
str = "<option value=''>请选择区服</option>"; var servers = result.data.servers
var str = "<option value=''>请选择区服</option>"
for (var i in data) { for (var i in servers){
str += "<option value='"+servers[i].server_id+"'>"+servers[i].server_name+"</option>"
str += "<option value='" + data[i].server_name + "'>" + data[i].server_name + "</option>" }
$("#server_id").empty()
$("#server_id").append(str)
$("#server_id").select2()
} }
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
} }
}) })
}) })
$("#server_js").click(function (event) { $("#server_js").click(function (event) {
var game_id = $("#game_id").val(); var game_id = $("#game_id").val();
if (game_id == 0) { if (game_id == 0) {
layer.msg('请先选择游戏'); layer.msg('请先选择游戏');
} }
}); });

@ -85,52 +85,55 @@
<div class="page-search normal_list promoteCoin-record-search" style="padding: 20px;"> <div class="page-search normal_list promoteCoin-record-search" style="padding: 20px;">
<div class="trunk-content article"> <div class="trunk-content article">
<div class="trunk-list list_normal"> <div class="trunk-list list_normal">
<div class="table-wrapper" style="height: 280px;"> <div class="table-wrapper" style="height: 200px;">
<table id="resource-table" class="table normal_table"> <table id="resource-table" class="table normal_table">
<tr class="odd zwm_tr"> <tr class="odd zwm_tr">
<th>申请ID</th> <th>申请ID</th>
<th>申请时间</th> <th>申请时间</th>
<th>游戏名称</th> <th>游戏名称</th>
<th>玩家账号</th>
<th>区服名称</th> <th>区服名称</th>
<th>角色名称</th> <th>角色名称</th>
<th>测试账号</th>
<th>手机号</th>
<th>申请人</th> <th>申请人</th>
<th>发放总金额</th> <th>资源内容</th>
<th>资源价值</th>
<th>申请数量</th>
<th>申请金额</th> <th>申请金额</th>
<th>应发金额</th> <th>申请备注</th>
<th>审核备注</th>
<th>审核状态</th> <th>审核状态</th>
<th>发放状态</th> <th>发放状态</th>
</tr> </tr>
<empty name="records"> <empty name="records">
<tr><td colspan="16" style="text-align: center;height: 45vh;"><img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p></td></tr> <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 /> <else />
<volist name="records" id="record" mod="2"> <volist name="records" id="record" mod="2">
<tr data-id="{$record.id}" class="<eq name='mod' value='1'>odd</eq>"> <tr data-id="{$record.id}" class="<eq name='mod' value='1'>odd</eq>">
<td>{$record.id}</td> <td>{$record.id}</td>
<td>{$record.create_time}</td> <td>
<?=substr($record['create_time'], 0, 10)?>
<br>
<?=substr($record['create_time'], 10)?>
</td>
<td>{$record.game_name}</td> <td>{$record.game_name}</td>
<td>{$record.user_account}</td>
<td>{$record.server_name}</td> <td>{$record.server_name}</td>
<td>{$record.role_name}</td> <td>{$record.role_name}</td>
<td>{$record.user_account}</td>
<td>{$record.user_phone}</td>
<td>{$record.apply_promote_account}</td> <td>{$record.apply_promote_account}</td>
<td>{$record.history_provide_amount}</td> <td>{$record.ref_name}</td>
<td>{$record.apply_amount}</td> <td>{$record.ref_amount}</td>
<td>{$record.provide_amount}</td> <td>{$record.num}</td>
<td>{$record.amount}</td>
<td>{$record.remark}</td> <td>{$record.remark}</td>
<td>{$record.verify_status_text}</td> <td>{$record.verify_status_text}</td>
<td>{$record.status_text}</td>
<td>{$record.provide_status_text}</td> <td>{$record.provide_status_text}</td>
</tr> </tr>
</volist> </volist>
</empty> </empty>
</table> </table>
</div> </div>
<div class="pagenation clearfix"> <!-- <div class="pagenation clearfix">
{$pagination} {$pagination}
</div> </div> -->
</div> </div>
</div> </div>
</div> </div>

@ -2455,6 +2455,7 @@ CREATE TABLE `tab_testing_resource_order` (
`order_no` varchar(32) NOT NULL COMMENT '订单号', `order_no` varchar(32) NOT NULL COMMENT '订单号',
`ref_id` varchar(30) NOT NULL COMMENT '测试资源ID第三方', `ref_id` varchar(30) NOT NULL COMMENT '测试资源ID第三方',
`ref_name` varchar(150) NOT NULL COMMENT '测试资源名称(第三方)', `ref_name` varchar(150) NOT NULL COMMENT '测试资源名称(第三方)',
`ref_amount` decimal(12, 2) not null default '0.00' comment '测试资源价值(第三方)',
`num` int(11) NOT NULL DEFAULT 0 COMMENT '申请数量', `num` int(11) NOT NULL DEFAULT 0 COMMENT '申请数量',
`provide_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 待发放 1 已经发放 2 拒绝 3 异常', `provide_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 待发放 1 已经发放 2 拒绝 3 异常',
`amount` decimal(12, 2) not null default '0.00' comment '申请金额', `amount` decimal(12, 2) not null default '0.00' comment '申请金额',

Loading…
Cancel
Save