管理后台更新

master
chenxiaojun 5 years ago
parent f1b454627e
commit cbe40d4b0f

@ -117,7 +117,7 @@ class PromoteGameRatioController extends ThinkController
$thisRatioDtl = "默认:{$promoteGameRatio['ratio']}%";
if ($thisTurnoverRatios) {
foreach ($thisTurnoverRatios as $thisTurnoverRatio) {
$thisIntervalClosedStatusText = isset($thisTurnoverRatio['interval_closed_status']) ? ($thisTurnoverRatio['interval_closed_status'] == 1 ? '≥' : '>') : '≥';
$thisIntervalClosedStatusText = isset($thisTurnoverRatio['instanceof']) ? ($thisTurnoverRatio['instanceof'] == 1 ? '≥' : '>') : '≥';
$thisRatioDtl .= "<br>月流水{$thisIntervalClosedStatusText}{$thisTurnoverRatio['turnover']},比例:{$thisTurnoverRatio['ratio']}%";
}
}
@ -232,8 +232,8 @@ class PromoteGameRatioController extends ThinkController
$this->error('默认分成比例不能为空');
}
$save['turnover_ratio'] = [];
if (!empty(array_filter($params['turnover'])) || !empty(array_filter($params['turnover_ratio'])) || !empty(array_filter($params['interval_closed_status']))) {
if (is_array($params['turnover']) && is_array($params['turnover_ratio']) && is_array($params['interval_closed_status'])) {
if (!empty(array_filter($params['turnover'])) || !empty(array_filter($params['turnover_ratio'])) || !empty(array_filter($params['instanceof']))) {
if (is_array($params['turnover']) && is_array($params['turnover_ratio']) && is_array($params['instanceof'])) {
foreach ($params['turnover'] as $turnover) {
if (empty($turnover)) {
$this->error('月流水不能为空');
@ -244,7 +244,7 @@ class PromoteGameRatioController extends ThinkController
$this->error('月流水分成比例不能为空');
}
}
foreach ($params['interval_closed_status'] as $intervalClosedStatus) {
foreach ($params['instanceof'] as $intervalClosedStatus) {
if (!in_array($intervalClosedStatus, [1, 2])) {
$this->error('月流水分符号不能为空');
}
@ -270,14 +270,13 @@ class PromoteGameRatioController extends ThinkController
$save['turnover_ratio'][] = [
'turnover' => bcdiv($turnover, 1, 2),
'ratio' => bcdiv($params['turnover_ratio'][$key], 1, 2),
'interval_closed_status' => (isset($params['interval_closed_status'][$key]) ? $params['interval_closed_status'][$key] : 1),
'instanceof' => (isset($params['instanceof'][$key]) ? $params['instanceof'][$key] : 1),
];
}
$save['turnover_ratio'] = json_encode($save['turnover_ratio']);
}
}
$save['interval_closed_status'] = ($params['interval_closed_status'] ? ($params['interval_closed_status'] == 1 ? 1 : 2) : 1);
$save['ratio'] = $params['ratio'] ?? 0;
$save['begin_time'] = strtotime($params['begin_time']);
$save['end_time'] = $params['end_time'] ? (strtotime('+1 month', strtotime($params['end_time'])) - 1) : 0;
@ -290,7 +289,7 @@ class PromoteGameRatioController extends ThinkController
if (empty($promoteGameRatio)) {
$this->error('参数异常');
}
if ($promoteGameRatio['status'] == -1 || $save['interval_closed_status'] != $promoteGameRatio['interval_closed_status'] || $save['begin_time'] != $promoteGameRatio['begin_time'] || $save['end_time'] != $promoteGameRatio['end_time'] || $save['ratio'] != $promoteGameRatio['ratio'] || $save['remark'] != $promoteGameRatio['remark'] || $save['turnover_ratio'] != $promoteGameRatio['turnover_ratio']) {
if ($promoteGameRatio['status'] == -1 || $save['instanceof'] != $promoteGameRatio['instanceof'] || $save['begin_time'] != $promoteGameRatio['begin_time'] || $save['end_time'] != $promoteGameRatio['end_time'] || $save['ratio'] != $promoteGameRatio['ratio'] || $save['remark'] != $promoteGameRatio['remark'] || $save['turnover_ratio'] != $promoteGameRatio['turnover_ratio']) {
$this->isWithdraw($promoteGameRatio['promote_id'], $save['begin_time'], $save['end_time']);
if ($promoteGameRatio['status'] == 1) {

@ -279,7 +279,7 @@ class WithdrawModel extends Model{
->find()['sum_amount'];
$sumAmount = $sumAmount ?? 0;
foreach ($turnoverRatios as $turnoverRatio) {
if (empty($turnoverRatio['interval_closed_status']) || $turnoverRatio['interval_closed_status'] == 1) {
if (empty($turnoverRatio['instanceof']) || $turnoverRatio['instanceof'] == 1) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
@ -407,7 +407,7 @@ class WithdrawModel extends Model{
$sumAmount = $sumAmount ?? 0;
$ratio = 0;
foreach ($turnoverRatios as $turnoverRatio) {
if (empty($turnoverRatio['interval_closed_status']) || $turnoverRatio['interval_closed_status'] == 1) {
if (empty($turnoverRatio['instanceof']) || $turnoverRatio['instanceof'] == 1) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
@ -500,7 +500,7 @@ class WithdrawModel extends Model{
$sumAmount = $sumAmount ?? 0;
$ratio = 0;
foreach ($turnoverRatios as $turnoverRatio) {
if (empty($turnoverRatio['interval_closed_status']) || $turnoverRatio['interval_closed_status'] == 1) {
if (empty($turnoverRatio['instanceof']) || $turnoverRatio['instanceof'] == 1) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
@ -564,7 +564,7 @@ class WithdrawModel extends Model{
->find()['sum_amount'];
$sumAmount = $sumAmount ?? 0;
foreach ($turnoverRatios as $turnoverRatio) {
if (empty($turnoverRatio['interval_closed_status']) || $turnoverRatio['interval_closed_status'] == 1) {
if (empty($turnoverRatio['instanceof']) || $turnoverRatio['instanceof'] == 1) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;

@ -157,8 +157,8 @@
<div class="list-ratio">
<empty name="record['turnover_ratio']">
<div class="li-ratio">
<label class="interval_closed_status_text" style="margin-right: 10px;">月流水</label>
<select name="interval_closed_status[]" style="width: 50px;margin-right: 10px;">
<label class="instanceof_text" style="margin-right: 10px;">月流水</label>
<select name="instanceof[]" style="width: 50px;margin-right: 10px;">
<option value="1"></option>
<option value="2">></option>
</select>
@ -178,10 +178,10 @@
<else/>
<volist name="record['turnover_ratio']" key="key" id="vo">
<div class="li-ratio">
<label class="interval_closed_status_text" style="margin-right: 10px;">月流水</label>
<select name="interval_closed_status[]" style="width: 50px;margin-right: 10px;">
<option value="1" <if condition="empty($vo['interval_closed_status']) or $vo['interval_closed_status'] eq 1">selected</if>>≥</option>
<option value="2" <if condition="!empty($vo['interval_closed_status']) and $vo['interval_closed_status'] eq 2">selected</if>>></option>
<label class="instanceof_text" style="margin-right: 10px;">月流水</label>
<select name="instanceof[]" style="width: 50px;margin-right: 10px;">
<option value="1" <if condition="empty($vo['instanceof']) or $vo['instanceof'] eq 1">selected</if>>≥</option>
<option value="2" <if condition="!empty($vo['instanceof']) and $vo['instanceof'] eq 2">selected</if>>></option>
</select>
<div class="turnover">
<input type="text" class="txt" name="turnover[]" value="{$vo['turnover']|default=''}" placeholder="" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')" style="width: 100px;margin-right: 10px;">
@ -391,8 +391,8 @@ $(function(){
var delBtn = $('.iconfont-btn-del');
var html = '';
html += '<div class="li-ratio">';
html += '<label class="interval_closed_status_text">月流水:</label>';
html += '<select name="interval_closed_status[]" style="width: 50px;margin-right: 10px;">';
html += '<label class="instanceof_text">月流水:</label>';
html += '<select name="instanceof[]" style="width: 50px;margin-right: 10px;">';
html += '<option value="1"></option>';
html += '<option value="2">></option>';
html += '</select>';

Loading…
Cancel
Save