From 10665cc8695f955863300dc005dc5cc8a737df49 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 3 Feb 2020 17:57:42 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0>?=
=?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98>=E7=BB=93=E7=AE=97=E7=AE=A1?=
=?UTF-8?q?=E7=90=86>=E5=85=AC=E4=BC=9A=E5=88=86=E6=88=90=E7=AE=A1?=
=?UTF-8?q?=E7=90=86--=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Admin/Common/function.php | 16 ++-
.../PromoteGameRatioController.class.php | 113 +++++++++++++++---
.../View/PromoteGameRatio/applyRatio.html | 111 +++++++++++++++--
.../Admin/View/PromoteGameRatio/lists.html | 39 +++++-
Application/Common/Common/function.php | 18 +++
Data/update.sql | 4 +
6 files changed, 268 insertions(+), 33 deletions(-)
diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php
index 59f7e8482..7916130e1 100644
--- a/Application/Admin/Common/function.php
+++ b/Application/Admin/Common/function.php
@@ -706,16 +706,20 @@ function getPromoteAccount($promoteId)
return M('promote', 'tab_')->where($map)->getField('account');
}
-//获取推广员列表 $level 0-全部
-function getPromoteByLevel($level = 0)
+//获取推广员列表 $level 0-全部 $companyId 推广公司 0-全部
+function getPromoteByLevel($level = 0, $companyId = 0)
{
$field = 'id, account, real_name';
- if ($level) {
+ $map['_string'] = '1 = 1';
+ if ($level > 0) {
$map['level'] = $level;
- $promotes = M('promote', 'tab_')->field($field)->where($map)->select();
- } else {
- $promotes = M('promote', 'tab_')->field($field)->select();
}
+ if ($companyId > 0) {
+ $map['company_id'] = $companyId;
+ }
+
+ $promotes = M('promote', 'tab_')->field($field)->where($map)->select();
+
return $promotes;
}
diff --git a/Application/Admin/Controller/PromoteGameRatioController.class.php b/Application/Admin/Controller/PromoteGameRatioController.class.php
index 0f6701687..d752c51e0 100644
--- a/Application/Admin/Controller/PromoteGameRatioController.class.php
+++ b/Application/Admin/Controller/PromoteGameRatioController.class.php
@@ -22,22 +22,44 @@ class PromoteGameRatioController extends ThinkController
{
$params = I('get.');
$group = $params['group'] ?? 1;
+ $companyId = $params['company_id'] ?? 0;
+ $companyBelong = $params['company_belong'] ?? '';
$promoteId = $params['promote_id'] ?? 0;
$gameId = $params['game_id'] ?? 0;
+ $gameTypeId = $params['game_type_id'] ?? 0;
$status = $params['status'] ?? '';
$page = $params['p'] ? intval($params['p']) : 1;
$row = $params['row'] ? intval($params['row']) : 10;
$map['_string'] = 'game_id = relation_game_id';
+ $where['_string'] = '1 = 1';
+ if ($companyId || ($companyBelong !== '' && in_array($companyBelong, [0, 1]))) {
+ $promoteMap['_string'] = '1 = 1';
+ if ($companyId) {
+ $promoteMap['company_id'] = $companyId;
+ }
+ if ($companyBelong !== '' && in_array($companyBelong, [0, 1])) {
+ $promoteMap['company_belong'] = $companyBelong;
+ }
+ $promoteIds = D('promote')->where($promoteMap)->getField('id', true);
+ $promoteIds = $promoteIds ?? [-1];
+ $where['promote_id'] = ['in', $promoteIds];
+ }
if ($promoteId) {
$map['promote_id'] = intval($promoteId);
}
+ if ($gameTypeId) {
+ $gameIds = D('game')->where(['game_type_id' => $gameTypeId])->getField('id', true);
+ $gameIds = $gameIds ?? [-1];
+ $where['game_id'] = ['in', $gameIds];
+ }
if ($gameId) {
$map['game_id'] = intval($gameId);
}
if ($status !== '') {
$map['status'] = intval($status);
}
+ $map['_complex'] = $where;
$field = 'create_time, update_time';
if ($group == 1) {
@@ -68,8 +90,8 @@ class PromoteGameRatioController extends ThinkController
if ($promoteGameRatios) {
$promoteIds = array_column($promoteGameRatios, 'promote_id');
$gameIds = array_column($promoteGameRatios, 'game_id');
- $promoteFiled = 'id, account, mobile_phone, create_time, status, ver_status';
- $gameFiled = 'id, relation_game_name, ratio';
+ $promoteFiled = 'id, account, mobile_phone, create_time, status, ver_status, company_id, company_belong';
+ $gameFiled = 'id, relation_game_name, ratio, game_type_name';
$promotes = M('promote', 'tab_')->where(array('id' => ['in', $promoteIds]))->getField($promoteFiled, true);
$games = M('game', 'tab_')->where(array('id' => ['in', $gameIds]))->getField($gameFiled, true);
@@ -83,14 +105,22 @@ class PromoteGameRatioController extends ThinkController
$thisPromoteCreateTime = '未知';
$thisPromoteStatus = '待审核';
$thisPromoteVerStatus = '未知';
+ $thisCompanyName = '未知';
+ $thisCompanyBelong = '未知';
+ $thisGameTypeName = '未知';
$thisGameName = '未知';
$thisGameRatio = '0.00%';
$thisLastRatio = $promoteGameRatio['last_ratio'] . '%';
$thisLastTurnoverRatio = $promoteGameRatio['last_turnover_ratio'] ? json_decode($promoteGameRatio['last_turnover_ratio'], true) : [];
$thisLastRatio = $thisLastTurnoverRatio ? "{$thisLastRatio} - " . $thisLastTurnoverRatio[count($thisLastTurnoverRatio) - 1]['ratio'] . '%' : $thisLastRatio;
- $thisRatio = $promoteGameRatio['ratio'] . '%';
- $thisTurnoverRatio = $promoteGameRatio['turnover_ratio'] ? json_decode($promoteGameRatio['turnover_ratio'], true) : [];
- $thisRatio = $thisTurnoverRatio ? "{$thisRatio} - " . $thisTurnoverRatio[count($thisTurnoverRatio) - 1]['ratio'] . '%' : $thisRatio;
+ $thisTurnoverRatios = $promoteGameRatio['turnover_ratio'] ? json_decode($promoteGameRatio['turnover_ratio'], true) : [];
+ $thisRatioDtl = "默认:{$promoteGameRatio['ratio']}%";
+ if ($thisTurnoverRatios) {
+ $thisIntervalClosedStatusText = ($promoteGameRatio['interval_closed_status'] == 1 ? '≥' : '>');
+ foreach ($thisTurnoverRatios as $thisTurnoverRatio) {
+ $thisRatioDtl .= "
月流水{$thisIntervalClosedStatusText}{$thisTurnoverRatio['turnover']},比例:{$thisTurnoverRatio['ratio']}%";
+ }
+ }
$thisLastRatioStatus = $promoteGameRatio['last_ratio_status'];
$thisStatusText = self::$statusList[$promoteGameRatio['status']];
$thisStatusText = ($promoteGameRatio['status'] == -1) ? '' . $thisStatusText . '' : $thisStatusText;
@@ -106,11 +136,14 @@ class PromoteGameRatioController extends ThinkController
$thisPromoteStatus = get_info_status($promotes[$thisPromoteId]['status'], 3);
$thisPromoteStatus = $thisPromoteStatus ?? '待审核';
$thisPromoteVerStatus = getPromoteVerStatus($promotes[$thisPromoteId]['ver_status'], 2);
+ $thisCompanyName = getPromoteCompanyName($promotes[$thisPromoteId]['company_id']);
+ $thisCompanyBelong = $promotes[$thisPromoteId]['company_belong'] == 1 ? '外团' : '内团';
}
if ($issetGame) {
$thisGameName = $games[$thisGameId]['relation_game_name'];
$thisGameRatio = $games[$thisGameId]['ratio'];
$thisGameRatio = ($thisGameRatio ?? '0.00') . '%';
+ $thisGameTypeName = $games[$thisGameId]['game_type_name'];
}
$record = [
@@ -121,9 +154,12 @@ class PromoteGameRatioController extends ThinkController
'promote_create_time' => $thisPromoteCreateTime,
'promote_status_text' => $thisPromoteStatus,
'promote_ver_status_text' => $thisPromoteVerStatus,
+ 'company_name' => $thisCompanyName,
+ 'company_belong' => $thisCompanyBelong,
'game_name' => $thisGameName,
+ 'game_type_name' => $thisGameTypeName,
'last_ratio' => (($thisLastRatioStatus == 1 || $group != 1) ? $thisLastRatio : $thisGameRatio),
- 'ratio' => $thisRatio,
+ 'ratio_dtl' => $thisRatioDtl,
'valid_date' => $validDate,
'remark' => $promoteGameRatio['remark'],
'status_text' => $thisStatusText,
@@ -158,16 +194,20 @@ class PromoteGameRatioController extends ThinkController
exit;
}
+ $gameTypelist = getGameTypes();
+ $companys = getPromoteCompanys();
$reviewRule = $this->getReviewRule();
$page = set_pagination($count, $row);
if($page) {
$this->assign('_page', $page);
}
+ $this->assign('companys', $companys);
+ $this->assign('gameTypeList', $gameTypelist);
$this->assign('group', $group);
$this->assign('records', $records);
$this->assign('count', $count);
$this->assign('gameList', getAllGameList(true));
- $this->assign('promoteList', getPromoteByLevel(1));
+ $this->assign('promoteList', getPromoteByLevel(1, intval(I('company_id', 0))));
$this->assign('statusList', self::$statusList);
$this->assign('reviewRule', $reviewRule);
$this->assign('is_admin', is_administrator());
@@ -231,6 +271,7 @@ class PromoteGameRatioController extends ThinkController
}
}
+ $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;
@@ -243,8 +284,8 @@ class PromoteGameRatioController extends ThinkController
if (empty($promoteGameRatio)) {
$this->error('参数异常');
}
- if ($promoteGameRatio['status'] == -1 || $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']);
+ 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']) {
+ $this->isWithdraw($promoteGameRatio['promote_id'], $save['begin_time'], $save['end_time']);
if ($promoteGameRatio['status'] == 1) {
$save['last_turnover_ratio'] = $promoteGameRatio['turnover_ratio'];
@@ -293,7 +334,7 @@ class PromoteGameRatioController extends ThinkController
$this->error('参数异常');
}
- $this->isWithdraw($promoteId, $save['begin_time']);
+ $this->isWithdraw($promoteId, $save['begin_time'], $save['end_time']);
$map['promote_id'] = $promoteId;
$save['promote_id'] = $promoteId;
@@ -329,6 +370,7 @@ class PromoteGameRatioController extends ThinkController
$params = I('get.');
$id = $params['id'] ?? 0;
$id = intval($id);
+ $companyId = 0;
$metaTitle = '游戏分成比例申请';
if ($id) {
$metaTitle .= '--修改';
@@ -347,18 +389,30 @@ class PromoteGameRatioController extends ThinkController
$lastRatio = ($gameRatio ?? '0.00') . '%';
}
+ $companyId = $promoteGameRatio['company_id'];
+ $promoteGameRatio['company_id'] = D('promote')->where(['id' => $promoteGameRatio['promote_id']])->getField('company_id');
$this->assign('record', $promoteGameRatio);
$this->assign('lastRatio', $lastRatio);
}
+ $companys = getPromoteCompanys();
+ $this->assign('companys', $companys);
$this->assign('gameList', getAllGameList(true));
- $this->assign('promoteList', getPromoteByLevel(1));
+ $this->assign('promoteList', getPromoteByLevel(1, $companyId));
$this->meta_title = $metaTitle;
$this->display();
}
}
- private function isWithdraw($promoteId, $beginTime)
+ public function getPromotes()
+ {
+ $level = 1;
+ $companyId = intval(I('company_id', 0));
+ $promotes = getPromoteByLevel($level, $companyId);
+ $this->ajaxReturn($promotes);
+ }
+
+ private function isWithdraw($promoteId, $beginTime, $endTime)
{
$promote = M('promote', 'tab_')->find($promoteId);
if (empty($promote)) {
@@ -370,11 +424,38 @@ class PromoteGameRatioController extends ThinkController
$withdrawMap['promote_id'] = $promoteId;
$withdrawMap['status'] = ['neq', -2];
+ if (empty($endTime)) {
+ $withdrawWhere['settlement_begin_time'] = ['egt', $beginTime];
+ $withdrawWhere['settlement_end_time'] = ['egt', $beginTime];
+ } else {
+ $withdrawWhere['settlement_begin_time'] = ['between', [$beginTime, $endTime]];
+ $withdrawWhere['settlement_end_time'] = ['between', [$beginTime, $endTime]];
+ }
+ $withdrawWhere['_logic'] = 'or';
+ $withdrawMap['_complex'] = $withdrawWhere;
$withdrawMap['settlement_begin_time'] = ['egt', $beginTime];
- $withdraw = M('withdraw', 'tab_')->where($withdrawMap)->order('create_time desc')->find();
- if (!empty($withdraw) && $withdraw['status'] != -2) {
- $time = date('Y-m', $beginTime);
- $this->error("{$time}月已有订单申请提现, 无法变更分成比例,请重新选择开始时间");
+ $withdraws = M('withdraw', 'tab_')->field('settlement_begin_time, settlement_end_time')
+ ->where($withdrawMap)
+ ->order('settlement_begin_time asc, settlement_end_time asc')
+ ->select();
+ if (!empty($withdraws)) {
+ $times = [];
+ $text = '';
+ foreach ($withdraws as $withdraw) {
+ $settlementBeginTime = !empty($withdraw['settlement_begin_time']) ? date('Y-m', $withdraw['settlement_begin_time']) : '';
+ $settlementEndTime = date('Y-m', $withdraw['settlement_end_time']);
+ if ($settlementBeginTime && !in_array($settlementBeginTime, $times)) {
+ $times[] = $settlementBeginTime;
+ $text .= "{$settlementBeginTime}月、";
+ }
+ if (!in_array($settlementEndTime, $times)) {
+ $times[] = $settlementEndTime;
+ $text .= "{$settlementEndTime}月、";
+ }
+ }
+ $text = rtrim($text, '、');
+ $text .= '已有订单申请提现, 无法变更分成比例,请重新选择开始时间';
+ $this->error($text);
}
}
diff --git a/Application/Admin/View/PromoteGameRatio/applyRatio.html b/Application/Admin/View/PromoteGameRatio/applyRatio.html
index a75a45d7a..8f70d7356 100644
--- a/Application/Admin/View/PromoteGameRatio/applyRatio.html
+++ b/Application/Admin/View/PromoteGameRatio/applyRatio.html
@@ -81,8 +81,26 @@
*会长账号: | +*推广公司: | + + + | +||||||||||||||||||||||||||||||||
*会长账号: | +||||||||||||||||||||||||||||||||||
月流水类型: | ++ + + + + | +|||||||||||||||||||||||||||||||||
现分成比例: |
@@ -139,7 +176,13 @@
-
+
@@ -156,7 +199,13 @@
-
+
@@ -240,6 +289,8 @@ highlight_subnav('{:U('PromoteGameRatio/lists')}');
$(".select_gallery").select2();
$(function(){
+ var intervalClosedStatusText = '月流水大于等于:';
+
$('.time').datetimepicker({
format: 'yyyy-mm',
language: "zh-CN",
@@ -259,6 +310,30 @@ $(function(){
promoteGameRatioData.end_time = '';
promoteGameRatioData.remark = '';
+ $('#company_id').change(function (e) {
+ var companyId = parseInt($(this).val());
+ $.ajax({
+ type: 'post',
+ url: "{:U('getPromotes')}",
+ dataType: 'json',
+ data: {'company_id': companyId},
+ success: function (data) {
+ var html = '';
+ if (data.length > 0) {
+ for (let i = 0;i < data.length;i++) {
+ html += '';
+ }
+ }
+ $('#promote_id').html(html);
+ $('#promote_id').select2();
+ getPromoteGameRatio();
+ },
+ error: function (result) {
+ console.log(result);
+ }
+ });
+ });
+
$('#ratio, #begin_time, #end_time, #remark').change(function () {
var val = $(this).val();
var elementIdName = $(this).attr('id');
@@ -266,13 +341,14 @@ $(function(){
});
$('#promote_id, #game_id').change(function () {
- var promoteId = parseInt($('#promote_id').val());
- var gameId = parseInt($('#game_id').val());
- getPromoteGameRatio(promoteId, gameId);
+ getPromoteGameRatio();
});
- function getPromoteGameRatio(promoteId, gameId)
+ function getPromoteGameRatio()
{
+ var promoteId = parseInt($('#promote_id').val());
+ var gameId = parseInt($('#game_id').val());
+
$.ajax({
type: 'post',
url: "{:U('getPromoteGameRatio')}",
@@ -299,6 +375,25 @@ $(function(){
});
}
+ $('.interval_closed_status').change(function (e) {
+ var intervalClosedStatus = parseInt($("input[name=interval_closed_status]:checked").val());
+ var html = '';
+ switch (intervalClosedStatus) {
+ case 1:
+ html = '月流水大于等于:';
+ break;
+ case 2:
+ html = '月流水大于:';
+ break;
+ }
+
+ intervalClosedStatusText = html;
+ $('.interval_closed_status_text').text(html);
+ });
+ $('input[name=interval_closed_status]').change(function (e) {
+
+ });
+
$('#submit').click(function (e) {
var target = $('form').get(0).action;
var query = $('form').serialize();
@@ -340,7 +435,7 @@ $(function(){
var delBtn = $('.iconfont-btn-del');
var html = '';
html += ' ';
- html += '';
+ html += '';
html += ' ';
html += '';
html += '';
diff --git a/Application/Admin/View/PromoteGameRatio/lists.html b/Application/Admin/View/PromoteGameRatio/lists.html
index a9cb1d8f5..5d0461650 100644
--- a/Application/Admin/View/PromoteGameRatio/lists.html
+++ b/Application/Admin/View/PromoteGameRatio/lists.html
@@ -72,6 +72,21 @@
+
+
+
+
+
+
+
+
+
提现单号 |
提现金额 |
+ 推广公司 |
推广员账号 |
操作人 |
操作人类型 |
@@ -158,41 +168,19 @@
|
{$data.widthdraw_number} | {$data.sum_money} | -- - {:get_promote_name($data['promote_id'])} - | -
- |
- {:getPromoteWithdrawOpType($data['op_type'])} | -
- |
- {:getPromoteWithdrawOpType($data['last_op_type'])} | -{:getPromoteWithdrawSettlementType($data['settlement_type'])} | -style="color: #999;">{:promoteWithdrawStatus($data['status'])} | +{$data.company_name} | +{$data.promote_account} | +{$data.op_id_text} | +{$data.op_type_text} | +{$data.last_op_id_text} | +{$data.last_op_type_text} | +{$data.settlement_type_text} | +{$data.settlement_begin_time} | +{$data.settlement_end_time} | +{$data.create_time} | +{$data.status_text} | {$data.respond} | -{$data.audit_time} |
月流水{$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']))) { - if (is_array($params['turnover']) && is_array($params['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'])) { foreach ($params['turnover'] as $turnover) { if (empty($turnover)) { $this->error('月流水不能为空'); @@ -244,6 +244,11 @@ class PromoteGameRatioController extends ThinkController $this->error('月流水分成比例不能为空'); } } + foreach ($params['interval_closed_status'] as $intervalClosedStatus) { + if (!in_array($intervalClosedStatus, [1, 2])) { + $this->error('月流水分符号不能为空'); + } + } $turnoverCount = count($params['turnover']); $sortTurnover = $params['turnover']; sort($sortTurnover); @@ -265,6 +270,7 @@ 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), ]; } $save['turnover_ratio'] = json_encode($save['turnover_ratio']); diff --git a/Application/Admin/Model/WithdrawModel.class.php b/Application/Admin/Model/WithdrawModel.class.php index f4fe43914..e937a96a6 100644 --- a/Application/Admin/Model/WithdrawModel.class.php +++ b/Application/Admin/Model/WithdrawModel.class.php @@ -252,7 +252,7 @@ class WithdrawModel extends Model{ $promoteGameRatioMap['status'] = 1; $promoteGameRatioMap['promote_id'] = $promote['id']; - $promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time, interval_closed_status') + $promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time') ->where($promoteGameRatioMap) ->order('update_time desc') ->select(); @@ -278,15 +278,13 @@ class WithdrawModel extends Model{ ->where($spendWhere) ->find()['sum_amount']; $sumAmount = $sumAmount ?? 0; - if ($promoteGameRatio['interval_closed_status'] == 1) { - foreach ($turnoverRatios as $turnoverRatio) { + foreach ($turnoverRatios as $turnoverRatio) { + if (empty($turnoverRatio['interval_closed_status']) || $turnoverRatio['interval_closed_status'] == 1) { if ($sumAmount >= $turnoverRatio['turnover']) { $ratio = $turnoverRatio['ratio']; break; } - } - } else { - foreach ($turnoverRatios as $turnoverRatio) { + } else { if ($sumAmount > $turnoverRatio['turnover']) { $ratio = $turnoverRatio['ratio']; break; @@ -369,7 +367,7 @@ class WithdrawModel extends Model{ { $promoteGameRatioMap['status'] = 1; $promoteGameRatioMap['promote_id'] = $promote['id']; - $promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time, interval_closed_status') + $promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time') ->where($promoteGameRatioMap) ->order('update_time desc') ->select(); @@ -408,15 +406,13 @@ class WithdrawModel extends Model{ ->find()['sum_amount']; $sumAmount = $sumAmount ?? 0; $ratio = 0; - if ($promoteGameRatio['interval_closed_status'] == 1) { - foreach ($turnoverRatios as $turnoverRatio) { + foreach ($turnoverRatios as $turnoverRatio) { + if (empty($turnoverRatio['interval_closed_status']) || $turnoverRatio['interval_closed_status'] == 1) { if ($sumAmount >= $turnoverRatio['turnover']) { $ratio = $turnoverRatio['ratio']; break; } - } - } else { - foreach ($turnoverRatios as $turnoverRatio) { + } else { if ($sumAmount > $turnoverRatio['turnover']) { $ratio = $turnoverRatio['ratio']; break; @@ -475,7 +471,7 @@ class WithdrawModel extends Model{ { $promoteGameRatioMap['status'] = 1; $promoteGameRatioMap['promote_id'] = $promote['id']; - $promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time, interval_closed_status') + $promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time') ->where($promoteGameRatioMap) ->order('update_time desc') ->select(); @@ -503,15 +499,13 @@ class WithdrawModel extends Model{ ->find()['sum_amount']; $sumAmount = $sumAmount ?? 0; $ratio = 0; - if ($promoteGameRatio['interval_closed_status'] == 1) { - foreach ($turnoverRatios as $turnoverRatio) { + foreach ($turnoverRatios as $turnoverRatio) { + if (empty($turnoverRatio['interval_closed_status']) || $turnoverRatio['interval_closed_status'] == 1) { if ($sumAmount >= $turnoverRatio['turnover']) { $ratio = $turnoverRatio['ratio']; break; } - } - } else { - foreach ($turnoverRatios as $turnoverRatio) { + } else { if ($sumAmount > $turnoverRatio['turnover']) { $ratio = $turnoverRatio['ratio']; break; @@ -545,7 +539,7 @@ class WithdrawModel extends Model{ $promoteGameRatioMap['status'] = 1; $promoteGameRatioMap['promote_id'] = $promote['id']; - $promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time, interval_closed_status') + $promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time') ->where($promoteGameRatioMap) ->order('update_time desc') ->select(); @@ -569,15 +563,13 @@ class WithdrawModel extends Model{ ->where($spendWhere) ->find()['sum_amount']; $sumAmount = $sumAmount ?? 0; - if ($promoteGameRatio['interval_closed_status'] == 1) { - foreach ($turnoverRatios as $turnoverRatio) { + foreach ($turnoverRatios as $turnoverRatio) { + if (empty($turnoverRatio['interval_closed_status']) || $turnoverRatio['interval_closed_status'] == 1) { if ($sumAmount >= $turnoverRatio['turnover']) { $ratio = $turnoverRatio['ratio']; break; } - } - } else { - foreach ($turnoverRatios as $turnoverRatio) { + } else { if ($sumAmount > $turnoverRatio['turnover']) { $ratio = $turnoverRatio['ratio']; break; diff --git a/Application/Admin/View/PromoteGameRatio/applyRatio.html b/Application/Admin/View/PromoteGameRatio/applyRatio.html index 8f70d7356..ddb97a3c4 100644 --- a/Application/Admin/View/PromoteGameRatio/applyRatio.html +++ b/Application/Admin/View/PromoteGameRatio/applyRatio.html @@ -141,25 +141,6 @@ |
||||
月流水类型: | -- - - - - | -|||||||||||||||||||||||||||||||||
现分成比例: |
@@ -176,20 +157,18 @@
-
+
+
-
+
-
+
%
@@ -199,13 +178,11 @@
-
+
+
@@ -289,8 +266,6 @@ highlight_subnav('{:U('PromoteGameRatio/lists')}');
$(".select_gallery").select2();
$(function(){
- var intervalClosedStatusText = '月流水大于等于:';
-
$('.time').datetimepicker({
format: 'yyyy-mm',
language: "zh-CN",
@@ -375,25 +350,6 @@ $(function(){
});
}
- $('.interval_closed_status').change(function (e) {
- var intervalClosedStatus = parseInt($("input[name=interval_closed_status]:checked").val());
- var html = '';
- switch (intervalClosedStatus) {
- case 1:
- html = '月流水大于等于:';
- break;
- case 2:
- html = '月流水大于:';
- break;
- }
-
- intervalClosedStatusText = html;
- $('.interval_closed_status_text').text(html);
- });
- $('input[name=interval_closed_status]').change(function (e) {
-
- });
-
$('#submit').click(function (e) {
var target = $('form').get(0).action;
var query = $('form').serialize();
@@ -435,14 +391,18 @@ $(function(){
var delBtn = $('.iconfont-btn-del');
var html = '';
html += ' ';
- html += '';
+ html += '';
+ html += ' ';
- html += '';
+ html += '';
html += '';
html += ' ';
html += '';
html += '';
- html += '';
+ html += '';
html += '%';
html += '';
html += ' ';
diff --git a/Data/update.sql b/Data/update.sql
index 297b625d3..e9f221550 100644
--- a/Data/update.sql
+++ b/Data/update.sql
@@ -1102,10 +1102,6 @@ ADD COLUMN `can_view_recharge` tinyint(1) NOT NULL default 0 COMMENT '是否显
ALTER TABLE `tab_promote_belong`
ADD COLUMN `can_view_recharge` tinyint(1) NOT NULL default 0 COMMENT '是否显示充值数据 0否 1是';
--- 2020-02-03
-ALTER TABLE `tab_promote_game_ratio`
-ADD COLUMN `interval_closed_status` tinyint(3) NOT NULL DEFAULT 1 COMMENT '区间闭合状态:1-闭合 2-不闭合' AFTER `last_turnover_ratio`;
-
-- 2020-02-04
ALTER TABLE `tab_promote`
ADD COLUMN `auto_review_withdraw_status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '提现自动审核状态:0-关闭 1-开启';
From 37ab08b9be27adedb59a5879bc270fd044e941d8 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Wed, 5 Feb 2020 14:24:23 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0>?=
=?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98>=E7=BB=93=E7=AE=97=E7=AE=A1?=
=?UTF-8?q?=E7=90=86>=E5=85=AC=E4=BC=9A=E5=88=86=E6=88=90=E7=AE=A1?=
=?UTF-8?q?=E7=90=86--=E8=A7=84=E5=88=99=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/Controller/PromoteGameRatioController.class.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/Application/Admin/Controller/PromoteGameRatioController.class.php b/Application/Admin/Controller/PromoteGameRatioController.class.php
index 36dfa12c5..a0db7e13b 100644
--- a/Application/Admin/Controller/PromoteGameRatioController.class.php
+++ b/Application/Admin/Controller/PromoteGameRatioController.class.php
@@ -298,6 +298,7 @@ class PromoteGameRatioController extends ThinkController
$save['last_ratio'] = $promoteGameRatio['ratio'];
$save['last_ratio_status'] = 1;
}
+ $saveMap['promote_id'] = $promoteGameRatio['promote_id'];
$saveMap['relation_game_id'] = $promoteGameRatio['relation_game_id'];
$result = D(self::MODEL_NAME)->where($saveMap)->save($save);
$logResult = $result;
|