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);