Merge pull request '额外额度、申请批次修改' (#162) from feature/TestingResource-0205 into release

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/162
master
廖金灵 4 years ago
commit e17eeae704

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