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