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('pagination', $pagination);
$this->assign('records', $records);
@ -193,10 +195,10 @@ class TestingResourceController extends BaseController
public function batches()
{
$verifyTimeStart = I('verify_time_start', '');
$verifyTimeEnd = I('verify_time_end', '');
$provideTimeStart = I('provide_time_start', '');
$provideTimeEnd = I('provide_time_end', '');
$verifyStatus = I('verify_status', -1);
$status = I('status', -1);
$provideStatus = I('provide_status', -1);
$account = I('account');
$loginPromote = $this->getLoginPromote();
@ -209,17 +211,17 @@ class TestingResourceController extends BaseController
$conditions = [
'_string' => 'exists (' . $subSql . ')'
];
if ($verifyTimeStart) {
$conditions['verify_time'] = ['egt', strtotime($verifyTimeStart . ' 00:00:00')];
if ($provideTimeStart) {
$conditions['provide_time'] = ['egt', strtotime($provideTimeStart . ' 00:00:00')];
}
if ($verifyTimeEnd) {
$conditions['verify_time'] = ['elt', strtotime($verifyTimeEnd . ' 23:59:59')];
if ($provideTimeEnd) {
$conditions['provide_time'] = ['elt', strtotime($provideTimeEnd . ' 23:59:59')];
}
if ($verifyStatus != -1) {
$conditions['verify_status'] = $verifyStatus;
}
if ($status != -1) {
$conditions['status'] = $status;
if ($provideStatus != -1) {
$conditions['provide_status'] = $provideStatus;
}
if ($account) {
$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 = [];
foreach ($batches as $batch) {
$roleKey = $this->getGameRoleId($batch['game_id'], $batch['role_id']);
@ -280,15 +294,19 @@ class TestingResourceController extends BaseController
'history_provide_amount' => 0.00,
'apply_amount' => $batch['apply_amount'],
'provide_amount' => $batch['provide_amount'],
'verify_status_text' => $batch['verify_status'],
'verify_time' => date('Y-m-d H:i:s', $batch['verify_time']),
'status_text' => $batch['status'],
'provide_status_text' => $batch['provide_status'],
'provide_time' => date('Y-m-d H:i:s', $batch['provide_time']),
'verify_status' => $batch['verify_status'],
'verify_status_text' => $verifyStatusList[$batch['verify_status']],
'verify_time' => $batch['verify_time'] == 0 ? '--' : date('Y-m-d H:i:s', $batch['verify_time']),
'provide_status' => $batch['provide_status'],
'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,
];
}
$this->assign('provideStatusList', $provideStatusList);
$this->assign('servers', $this->getServersByGameId($gameId));
$this->assign('games', $this->getGames());
$this->assign('count', $count);
$this->assign('pagination', $pagination);
$this->assign('records', $records);
@ -297,14 +315,53 @@ class TestingResourceController extends BaseController
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);
/**
* @todo
*/
$provideStatusList = [
'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('pagination', $pagination);
@ -474,6 +531,7 @@ class TestingResourceController extends BaseController
'order_no' => $orderNo,
'ref_id' => $record['resource_id'],
'ref_name' => $record['resource_name'],
'ref_amount' => $record['value'],
'num' => $record['num'],
'amount' => $record['num'] * $record['value'],
'remark' => $record['remark'],
@ -561,16 +619,32 @@ class TestingResourceController extends BaseController
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['game_id'] = $gameId;
$servers = M('server', 'tab_')
return M('server', 'tab_')
->field('id,server_name,server_id')
->where($map)
->order('server_id asc')
->select();
}
public function getServers()
{
$gameId = I('game_id', 0);
$servers = $this->getServersByGameId($gameId);
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['servers' => $servers]]);
}
@ -658,9 +732,4 @@ class TestingResourceController extends BaseController
}
return $resources;
}
private function getRemainAmount($user)
{
}
}

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

@ -40,51 +40,56 @@
<div class="form-group normal_space fr">
<input type="submit" class="submit" id='submit' value="查询" url="{:U('lists',['type'=>I('type')])}" style="cursor:pointer;">
</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;">
<label class="form-title select-title" style="margin-right: 9px;"></label>
<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 class="form-group normal_space fr">
<label class="form-title select-title">申请时间:</label>
<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 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 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">
<span id="server_js">
<select id="server_id" name="server_name" class="reselect select_gallery" style="width:101px">
<option game-id="0" value="">请选择区服</option>
<volist name=":getServer_name_on($_GET['game_name'])" id="vo">
<option value="{$vo.server_name}" <if condition="$_GET['server_name'] eq $vo['server_name']">selected="selected"</if>>{$vo.server_name}</option>
</volist>
<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;?>>
<?=$server['server_name']?>
</option>
<?php endforeach;?>
</select>
</span>
</div>
<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>
<volist name=":get_game_list()" id="vo">
<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>
</volist>
<?php foreach($games as $game):?>
<option game-id="<?=$game['id']?>" value="<?=$game['id']?>" <?php if($game['id'] == I('game_id')):?>selected="selected"<?php endif;?>>
<?=$game['game_name']?>
</option>
<?php endforeach;?>
</select>
</div>
</div>
</div>
</div>
@ -192,6 +197,22 @@ $().ready(function(){
formatDate:'Y-m-d',
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 type="text/javascript">
@ -235,51 +256,26 @@ $("#submit").click(function(){
$("#game_id").change(function(){
$.ajax({
url:"{:U('getServer')}",
type:"post",
data:{game_id:$("#game_id option:selected").attr('game-id')},
dataType:'json',
success:function(data){
console.log(data);
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"'>"+data[i].server_name+"</option>"
url: "{:U('getServers')}",
type: "post",
data: {game_id:$("#game_id option:selected").attr('game-id')},
dataType: 'json',
success: function(result) {
if (result.status == 1) {
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>"
}
$("#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) {
var game_id=$("#game_id").val();
if(game_id==0){
layer.msg('请先选择游戏');
}
});
function webchat_chkkeysend(event)
{
if (event.keyCode==13) {

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

@ -85,52 +85,55 @@
<div class="page-search normal_list promoteCoin-record-search" style="padding: 20px;">
<div class="trunk-content article">
<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">
<tr class="odd zwm_tr">
<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>
</tr>
<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 />
<volist name="records" id="record" mod="2">
<tr data-id="{$record.id}" class="<eq name='mod' value='1'>odd</eq>">
<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.user_account}</td>
<td>{$record.server_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.history_provide_amount}</td>
<td>{$record.apply_amount}</td>
<td>{$record.provide_amount}</td>
<td>{$record.ref_name}</td>
<td>{$record.ref_amount}</td>
<td>{$record.num}</td>
<td>{$record.amount}</td>
<td>{$record.remark}</td>
<td>{$record.verify_status_text}</td>
<td>{$record.status_text}</td>
<td>{$record.provide_status_text}</td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
<!-- <div class="pagenation clearfix">
{$pagination}
</div>
</div> -->
</div>
</div>
</div>

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

Loading…
Cancel
Save