测试资源数量可手动控制

master
elf 2 years ago
parent 93099acdcc
commit 8c1cc90185

@ -438,7 +438,8 @@ class TestingResourceController extends ThinkController
}
$hasItf = 0;
$isEnableNum = 0;
$servers = [];
$bindingRole = null;
if ($role) {
@ -469,6 +470,7 @@ class TestingResourceController extends ThinkController
$gameSetting = $repository->getGameSettingByGameId($role['game_id']);
$hasItf = $gameSetting ? $gameSetting['has_itf'] : 0;
$isEnableNum = $gameSetting ? $gameSetting['is_enable_num'] : 0;
}
$testingResourceService = new TestingResourceService();
@ -476,6 +478,7 @@ class TestingResourceController extends ThinkController
$games = M('game', 'tab_')->field(['id' , 'game_name'])->select();
$this->assign('isEnableNum', $isEnableNum);
$this->assign('hasItf', $hasItf);
$this->assign('games', $games);
$this->assign('servers', $servers);

@ -186,6 +186,7 @@ body {
<div class="clearfix" style="margin-top: 10px;">
<input id="hasItf" type="hidden" value="<?=$hasItf?>" name="has_itf">
<input id="isEnableNum" type="hidden" value="<?=$isEnableNum?>" name="is_enable_num">
<?php if ($hasItf):?>
<div class="form-group fl">
<select id="resource-type-select" name="resource_type_id" style="width:150px" class="select_gallery">
@ -204,8 +205,11 @@ body {
<p id="resource-amount" class="static-input">资源价值: --</p>
</div>
<div class="form-group fl">
<?php if ($isEnableNum):?>
<input id="num-input" type="text" name="num" class="txt normal_txt" placeholder="请输入资源数量" value="">
<?php else:?>
<p class="static-input">资源数量: 1</p>
<!-- <input id="num-input" type="text" name="num" class="txt normal_txt" id="uid" placeholder="请输入资源数量" value=""> -->
<?php endif;?>
</div>
<?php else:?>
<div class="form-group fl">
@ -289,6 +293,7 @@ body {
$(".select_gallery").select2()
var globalGameId = $('#game-select').val()
var hasItf = $('#hasItf').val()
var isEnableNum = $('#isEnableNum').val()
if (globalGameId > 0) {
initTable(globalGameId)
}
@ -465,8 +470,7 @@ body {
var resourceName = $('#resource-select option:selected').html()
var amount = $('#resource-select option:selected').attr('data-amount')
amount = amount == undefined ? '--' : amount
// var num = $('#num-input').val()
var num = 1
var num = isEnableNum == 1 ? $('#num-input').val() : 1
var remark = $('#remark-input').val()
if (resourceTypeId == '') {
@ -481,7 +485,9 @@ body {
if (!isNumber(num)) {
return layer.msg('资源数量只能为正整数')
}
if (num <= 0) {
return layer.msg('资源数量需要大于0')
}
var html = '<tr class="normal-row" data-resource-id="' + resourceId + '" data-resource-type-id="' + resourceTypeId + '" >' +
'<td>' + resourceTypeName + '</td>' +
'<td>' + resourceName + '</td>' +

@ -101,6 +101,7 @@ class LeyouClient
$data['type'] = 2;
} else {
$data['goods_id'] = $order['ref_id'];
$data['goods_num'] = $order['num'];
$data['type'] = 1;
}

@ -131,6 +131,7 @@ class TestingResourceController extends BaseController
}
$hasItf = 0;
$isEnableNum = 0;
$servers = [];
$bindingRole = null;
@ -161,11 +162,13 @@ class TestingResourceController extends BaseController
$repository = new TestingResourceRepository();
$gameSetting = $repository->getGameSettingByGameId($role['game_id']);
$hasItf = $gameSetting ? $gameSetting['has_itf'] : 0;
$isEnableNum = $gameSetting ? $gameSetting['is_enable_num'] : 0;
}
$testingResourceService = new TestingResourceService();
$quota = $testingResourceService->getRemainQuota($role, $bindingRole);
$this->assign('hasItf', $hasItf);
$this->assign('isEnableNum', $isEnableNum);
$games = M('game', 'tab_')->field(['id' , 'game_name'])->select();

@ -138,6 +138,7 @@
<?php endif;?>
<div class="clearfix" style="margin-top: 10px;">
<input id="hasItf" type="hidden" value="<?=$hasItf?>" name="has_itf">
<input id="isEnableNum" type="hidden" value="<?=$isEnableNum?>" name="is_enable_num">
<?php if ($hasItf):?>
<div class="form-group fl">
<select id="resource-type-select" name="resource_type_id" style="width:150px" class="select_gallery">
@ -156,8 +157,11 @@
<p id="resource-amount" class="static-input">资源价值: --</p>
</div>
<div class="form-group fl">
<?php if ($isEnableNum):?>
<input id="num-input" type="text" name="num" class="txt normal_txt" placeholder="请输入资源数量" value="">
<?php else:?>
<p class="static-input">资源数量: 1</p>
<!-- <input id="num-input" type="text" name="num" class="txt normal_txt" id="uid" placeholder="请输入资源数量" value=""> -->
<?php endif;?>
</div>
<?php else:?>
<div class="form-group fl">
@ -242,6 +246,7 @@
$(".select_gallery").select2()
var globalGameId = $('#game-select').val()
var hasItf = $('#hasItf').val()
var isEnableNum = $('#isEnableNum').val()
if (globalGameId > 0) {
initTable(globalGameId)
}
@ -418,8 +423,7 @@
var resourceName = $('#resource-select option:selected').html()
var amount = $('#resource-select option:selected').attr('data-amount')
amount = amount == undefined ? '--' : amount
// var num = $('#num-input').val()
var num = 1
var num = isEnableNum == 1 ? $('#num-input').val() : 1
var remark = $('#remark-input').val()
if (resourceTypeId == '') {
@ -434,6 +438,9 @@
if (!isNumber(num)) {
return layer.msg('资源数量只能为正整数')
}
if (num <= 0) {
return layer.msg('资源数量需要大于0')
}
var html = '<tr class="normal-row" data-resource-id="' + resourceId + '" data-resource-type-id="' + resourceTypeId + '" >' +
'<td>' + resourceTypeName + '</td>' +
@ -465,7 +472,7 @@
})
$('#resource-table').on('blur', 'input[name=amount]', function() {
if($(this).val() == '') {
return layer.msg('请输入资源数量')
return layer.msg('请输入资源价值')
} else {
statQuota()
}

Loading…
Cancel
Save