额外额度、申请批次修改

master
liyang 4 years ago
parent 84d6d1c145
commit 769a6974ab

@ -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' => '设置成功']);
}

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

@ -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("<option value='all' selected>全部</option>");

@ -48,6 +48,11 @@
.clearfix {
*zoom: 1;
}
#other_quota_remark {
width:250px;
height:130px;
padding: 0 10px;
}
</style>
</block>
<block name="body">
@ -242,6 +247,12 @@
<input type="text" class="form-input" name="other_quota" value="" style="width:250px">
</div>
</div>
<div class="form-group">
<label>备注信息:</label>
<div class="form-item" style="width: 280px;">
<textarea name="other_quota_remark"id="other_quota_remark" class="form-input" placeholder="100字以内" maxlength="100"></textarea>
</div>
</div>
<div class="form-group">
<label></label>
<a id="quota-submit" href="javascript:;" class="add-submit btn">确定</a>
@ -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("<option value='all' selected>全部</option>");
@ -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);

Loading…
Cancel
Save