优化游戏比例分成无需大于

master
chenzhi 4 years ago
parent 9dd4a507e9
commit 91ae987c3c

@ -653,15 +653,15 @@ class CompanyGameRatioController extends AdminController
$this->error('月流水必须以正序的方式填写,且必须大于上一个月流水'); $this->error('月流水必须以正序的方式填写,且必须大于上一个月流水');
} }
$ratio = $params['ratio'] ?? 0; $ratio = $params['ratio'] ?? 0;
if ($params['turnover_ratio'][0] <= $ratio) { // if ($params['turnover_ratio'][0] <= $ratio) {
$this->error('月流水分成比例必须大于默认分成比例'); // $this->error('月流水分成比例必须大于默认分成比例');
} // }
$turnoverRatioCount = count($params['turnover_ratio']); $turnoverRatioCount = count($params['turnover_ratio']);
$sortTurnoverRatio = $params['turnover_ratio']; $sortTurnoverRatio = $params['turnover_ratio'];
sort($sortTurnoverRatio); sort($sortTurnoverRatio);
if ($params['turnover_ratio'] != $sortTurnoverRatio || $turnoverRatioCount != count(array_unique($params['turnover_ratio']))) { // if ($params['turnover_ratio'] != $sortTurnoverRatio || $turnoverRatioCount != count(array_unique($params['turnover_ratio']))) {
$this->error('月流水分成比例必须以正序的方式填写,且必须大于上一个月流水分成比例'); // $this->error('月流水分成比例必须以正序的方式填写,且必须大于上一个月流水分成比例');
} // }
foreach ($params['turnover'] as $key => $turnover) { foreach ($params['turnover'] as $key => $turnover) {
$save['turnover_ratio'][] = [ $save['turnover_ratio'][] = [

@ -211,15 +211,15 @@ class GameRatioMouldController extends AdminController
$this->error('月流水必须以正序的方式填写,且必须大于上一个月流水'); $this->error('月流水必须以正序的方式填写,且必须大于上一个月流水');
} }
$ratio = $params['ratio'] ?? 0; $ratio = $params['ratio'] ?? 0;
if ($params['turnover_ratio'][0] <= $ratio) { // if ($params['turnover_ratio'][0] <= $ratio) {
$this->error('月流水分成比例必须大于默认分成比例'); // $this->error('月流水分成比例必须大于默认分成比例');
} // }
$turnoverRatioCount = count($params['turnover_ratio']); $turnoverRatioCount = count($params['turnover_ratio']);
$sortTurnoverRatio = $params['turnover_ratio']; $sortTurnoverRatio = $params['turnover_ratio'];
sort($sortTurnoverRatio); sort($sortTurnoverRatio);
if ($params['turnover_ratio'] != $sortTurnoverRatio || $turnoverRatioCount != count(array_unique($params['turnover_ratio']))) { // if ($params['turnover_ratio'] != $sortTurnoverRatio || $turnoverRatioCount != count(array_unique($params['turnover_ratio']))) {
$this->error('月流水分成比例必须以正序的方式填写,且必须大于上一个月流水分成比例'); // $this->error('月流水分成比例必须以正序的方式填写,且必须大于上一个月流水分成比例');
} // }
foreach ($params['turnover'] as $key => $turnover) { foreach ($params['turnover'] as $key => $turnover) {
$save['turnover_ratio'][] = [ $save['turnover_ratio'][] = [

@ -407,13 +407,13 @@ $(function(){
function prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that, isDefault = false) function prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that, isDefault = false)
{ {
if (thatTurnoverRatio <= prevTurnoverRatio) { // if (thatTurnoverRatio <= prevTurnoverRatio) {
var msg = isDefault ? '月流水分成比例必须大于默认分成比例' : '月流水分成比例必须大于上一个月流水分成比例'; // var msg = isDefault ? '月流水分成比例必须大于默认分成比例' : '月流水分成比例必须大于上一个月流水分成比例';
that.parent().children('.error-message').text(msg); // that.parent().children('.error-message').text(msg);
that.parent().children('.error-message').show(); // that.parent().children('.error-message').show();
} else { // } else {
that.parent().children('.error-message').hide(); // that.parent().children('.error-message').hide();
} // }
return true; return true;
} }

@ -408,13 +408,13 @@ $(function(){
function prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that, isDefault = false) function prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that, isDefault = false)
{ {
if (thatTurnoverRatio <= prevTurnoverRatio) { // if (thatTurnoverRatio <= prevTurnoverRatio) {
var msg = isDefault ? '月流水分成比例必须大于默认分成比例' : '月流水分成比例必须大于上一个月流水分成比例'; // var msg = isDefault ? '月流水分成比例必须大于默认分成比例' : '月流水分成比例必须大于上一个月流水分成比例';
that.parent().children('.error-message').text(msg); // that.parent().children('.error-message').text(msg);
that.parent().children('.error-message').show(); // that.parent().children('.error-message').show();
} else { // } else {
that.parent().children('.error-message').hide(); // that.parent().children('.error-message').hide();
} // }
return true; return true;
} }

@ -432,13 +432,13 @@ $(function(){
function prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that, isDefault = false) function prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that, isDefault = false)
{ {
if (thatTurnoverRatio <= prevTurnoverRatio) { // if (thatTurnoverRatio <= prevTurnoverRatio) {
var msg = isDefault ? '月流水分成比例必须大于默认分成比例' : '月流水分成比例必须大于上一个月流水分成比例'; // var msg = isDefault ? '月流水分成比例必须大于默认分成比例' : '月流水分成比例必须大于上一个月流水分成比例';
that.parent().children('.error-message').text(msg); // that.parent().children('.error-message').text(msg);
that.parent().children('.error-message').show(); // that.parent().children('.error-message').show();
} else { // } else {
that.parent().children('.error-message').hide(); // that.parent().children('.error-message').hide();
} // }
return true; return true;
} }

@ -434,13 +434,13 @@ $(function(){
function prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that, isDefault = false) function prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that, isDefault = false)
{ {
if (thatTurnoverRatio <= prevTurnoverRatio) { // if (thatTurnoverRatio <= prevTurnoverRatio) {
var msg = isDefault ? '月流水分成比例必须大于默认分成比例' : '月流水分成比例必须大于上一个月流水分成比例'; // var msg = isDefault ? '月流水分成比例必须大于默认分成比例' : '月流水分成比例必须大于上一个月流水分成比例';
that.parent().children('.error-message').text(msg); // that.parent().children('.error-message').text(msg);
that.parent().children('.error-message').show(); // that.parent().children('.error-message').show();
} else { // } else {
that.parent().children('.error-message').hide(); // that.parent().children('.error-message').hide();
} // }
return true; return true;
} }

Loading…
Cancel
Save