Skip to content

Commit fcae8ae

Browse files
author
zhangjiangbin
committed
积分范围限制
1 parent f47045c commit fcae8ae

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎resources/views/admin/system.blade.php‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,12 +999,18 @@ function setPaypalClientSecret() {
999999
// 设置最小积分
10001000
$("#min_rand_score").change(function () {
10011001
var min_rand_score = $(this).val();
1002+
var max_rand_score = $("#max_rand_score").val();
10021003
10031004
if (parseInt(min_rand_score) < 0) {
10041005
layer.msg('最小积分小于0', {time:1000});
10051006
return ;
10061007
}
10071008
1009+
if (parseInt(min_rand_score) >= parseInt(max_rand_score)) {
1010+
layer.msg('最小积分必须小于最大积分', {time:1000});
1011+
return ;
1012+
}
1013+
10081014
$.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'min_rand_score', value:min_rand_score}, function (ret) {
10091015
layer.msg(ret.message, {time:1000}, function() {
10101016
if (ret.status == 'fail') {
@@ -1016,13 +1022,19 @@ function setPaypalClientSecret() {
10161022
10171023
// 设置最大积分
10181024
$("#max_rand_score").change(function () {
1025+
var min_rand_score = $("#min_rand_score").val();
10191026
var max_rand_score = $(this).val();
10201027
10211028
if (parseInt(max_rand_score) > 99999) {
10221029
layer.msg('最大积分不能大于99999', {time:1000});
10231030
return ;
10241031
}
10251032
1033+
if (parseInt(min_rand_score) >= parseInt(max_rand_score)) {
1034+
layer.msg('最大积分必须大于最小积分', {time:1000});
1035+
return ;
1036+
}
1037+
10261038
$.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'max_rand_score', value:max_rand_score}, function (ret) {
10271039
layer.msg(ret.message, {time:1000}, function() {
10281040
if (ret.status == 'fail') {

0 commit comments

Comments
 (0)