From 769a6974ab4f41914df828f2e04131a7bca0c09b Mon Sep 17 00:00:00 2001 From: liyang <316606755@qq.com> Date: Fri, 5 Feb 2021 17:50:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=9D=E5=A4=96=E9=A2=9D=E5=BA=A6=E3=80=81?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=89=B9=E6=AC=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestingResourceController.class.php | 3 +- .../Admin/View/TestingResource/apply.html | 2 +- .../Admin/View/TestingResource/batches.html | 5 +++ .../Admin/View/TestingResource/index.html | 32 ++++++++++++++++--- 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/Application/Admin/Controller/TestingResourceController.class.php b/Application/Admin/Controller/TestingResourceController.class.php index cda26b748..1d730bc79 100644 --- a/Application/Admin/Controller/TestingResourceController.class.php +++ b/Application/Admin/Controller/TestingResourceController.class.php @@ -572,7 +572,8 @@ class TestingResourceController extends ThinkController { $id = I('id', 0); $otherQuota = I('other_quota', 0); - M('user_play_info', 'tab_')->where(['id' => $id])->save(['testing_other_quota' => $otherQuota]); + $otherQuotaRemark = I('otherQuotaRemark', ''); + M('user_play_info', 'tab_')->where(['id' => $id])->save(['testing_other_quota' => $otherQuota,'testing_other_quota_remark' => $otherQuotaRemark]); return $this->ajaxReturn(['status' => 1, 'message' => '设置成功']); } diff --git a/Application/Admin/View/TestingResource/apply.html b/Application/Admin/View/TestingResource/apply.html index 802c4de3d..153a22811 100644 --- a/Application/Admin/View/TestingResource/apply.html +++ b/Application/Admin/View/TestingResource/apply.html @@ -726,7 +726,7 @@ body { success: function(result){ if (result.status == 1) { layer.msg(result.message, function(){ - parent.window.location.href = "{:U('batches')}" + parent.window.location.href = "{:U('index')}" }) } else { layer.msg(result.message) diff --git a/Application/Admin/View/TestingResource/batches.html b/Application/Admin/View/TestingResource/batches.html index 9715e6c8c..757cc788f 100644 --- a/Application/Admin/View/TestingResource/batches.html +++ b/Application/Admin/View/TestingResource/batches.html @@ -318,6 +318,11 @@ //导航高亮 highlight_subnav("{:U('TestingResource/batches')}"); $(function(){ + // 五分钟定时刷新页面 + setInterval(function(){ + console.log('刷新5分钟') + location.reload(); + }, 300000); // 添加全部选项 if ('all' == "{:I('row', 0)}") { $("#pagechange").prepend(""); diff --git a/Application/Admin/View/TestingResource/index.html b/Application/Admin/View/TestingResource/index.html index a0ba8f644..59e7428ae 100644 --- a/Application/Admin/View/TestingResource/index.html +++ b/Application/Admin/View/TestingResource/index.html @@ -48,6 +48,11 @@ .clearfix { *zoom: 1; } + #other_quota_remark { + width:250px; + height:130px; + padding: 0 10px; + } @@ -242,6 +247,12 @@ +
+ +
+ +
+
确定 @@ -264,6 +275,10 @@ //导航高亮 highlight_subnav("{:U('TestingResource/index')}"); $(function(){ + // 全局变量声明 + var base_quota = 0; + var quota = 0; + var provide_amount = 0; // 添加全部选项 if ('all' == "{:I('row', 0)}") { $("#pagechange").prepend(""); @@ -336,7 +351,7 @@ title: '设置额外额度', type: 1, content: box, - area: ['500px', '200px'], + area: ['500px', '400px'], zIndex: 250, }) }) @@ -345,14 +360,23 @@ var box = $('#other-quota-box') var id = box.find('[name=id]').val() var otherQuota = box.find('[name=other_quota]').val() - if (!isNumber(otherQuota)) { - return layer.msg('额外额度只能为正整数') + var otherQuotaRemark = box.find('[name=other_quota_remark]').val() + if (!(parseInt(otherQuota, 10) == otherQuota)){ + return layer.msg('额外额度只能为整数') + } + // 初始金额+奖金(累计金额)+额外额度-累计已发放 + base_quota = parseInt(base_quota,10) //初始金额 + quota = parseInt(quota,10) //奖金=累计额度 + otherQuota = parseInt(otherQuota,10) //额外额度 + provide_amount = parseInt(provide_amount,10) //累计已发放 + if ((base_quota+quota+otherQuota-provide_amount) < 0){ + return layer.msg('额度不足,请重新设置') } $.ajax({ url: "{:U('setOtherQuota')}", type: "POST", dataType: "json", - data: { id: id, other_quota: otherQuota }, + data: { id: id, other_quota: otherQuota,otherQuotaRemark: otherQuotaRemark }, success: function (result) { if (result.status == 0) { layer.msg(result.message);