diff --git a/Application/Admin/Controller/TestingResourceController.class.php b/Application/Admin/Controller/TestingResourceController.class.php index 6ed20c1a5..60503e2b7 100644 --- a/Application/Admin/Controller/TestingResourceController.class.php +++ b/Application/Admin/Controller/TestingResourceController.class.php @@ -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); diff --git a/Application/Admin/View/TestingResource/apply.html b/Application/Admin/View/TestingResource/apply.html index 557f12371..bd00ef9d1 100644 --- a/Application/Admin/View/TestingResource/apply.html +++ b/Application/Admin/View/TestingResource/apply.html @@ -186,6 +186,7 @@ body {
+
+

资源数量: 1

- +
@@ -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 = '' + '' + resourceTypeName + '' + '' + resourceName + '' + diff --git a/Application/Base/Tool/GameResource/LeyouClient.class.php b/Application/Base/Tool/GameResource/LeyouClient.class.php index 1ba5ea35f..5198a6aa5 100644 --- a/Application/Base/Tool/GameResource/LeyouClient.class.php +++ b/Application/Base/Tool/GameResource/LeyouClient.class.php @@ -101,6 +101,7 @@ class LeyouClient $data['type'] = 2; } else { $data['goods_id'] = $order['ref_id']; + $data['goods_num'] = $order['num']; $data['type'] = 1; } diff --git a/Application/Home/Controller/TestingResourceController.class.php b/Application/Home/Controller/TestingResourceController.class.php index a48d5f2ce..825a854de 100644 --- a/Application/Home/Controller/TestingResourceController.class.php +++ b/Application/Home/Controller/TestingResourceController.class.php @@ -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(); diff --git a/Application/Home/View/default/TestingResource/apply.html b/Application/Home/View/default/TestingResource/apply.html index 0c52547e7..656b0dbd5 100644 --- a/Application/Home/View/default/TestingResource/apply.html +++ b/Application/Home/View/default/TestingResource/apply.html @@ -138,6 +138,7 @@
+
+

资源数量: 1

- +
@@ -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 = '' + '' + resourceTypeName + '' + @@ -465,7 +472,7 @@ }) $('#resource-table').on('blur', 'input[name=amount]', function() { if($(this).val() == '') { - return layer.msg('请输入资源数量') + return layer.msg('请输入资源价值') } else { statQuota() }