From 6b8e277fb1f1dba7509e47e958a8271b310f53f1 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 20 Dec 2019 14:56:43 +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=AE=A1=E7=90=86>=E5=85=AC?= =?UTF-8?q?=E4=BC=9A=E5=88=86=E6=88=90=E7=AE=A1=E7=90=86--=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/PromoteGameRatioController.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Application/Admin/Controller/PromoteGameRatioController.class.php b/Application/Admin/Controller/PromoteGameRatioController.class.php index 05bedf223..d8ea7d936 100644 --- a/Application/Admin/Controller/PromoteGameRatioController.class.php +++ b/Application/Admin/Controller/PromoteGameRatioController.class.php @@ -130,6 +130,11 @@ class PromoteGameRatioController extends ThinkController if (empty($params['begin_time'])) { $this->error('请选择开始时间'); } + if (!empty($params['end_time'])) { + if (strtotime($params['end_time']) < strtotime($params['begin_time'])) { + $this->error('结束时间不得小于开始时间'); + } + } $save['ratio'] = $params['ratio'] ?? 0; $save['begin_time'] = strtotime($params['begin_time']); $save['end_time'] = $params['end_time'] ? strtotime($params['end_time']) : 0; From e9f9a421f52fb05a5c1367aca35af5441c24950a Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 20 Dec 2019 15:07:13 +0800 Subject: [PATCH 2/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=AE=A1=E7=90=86>=E5=85=AC?= =?UTF-8?q?=E4=BC=9A=E5=88=86=E6=88=90=E7=AE=A1=E7=90=86--=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Common/Common/extend.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index a47c1b93e..b34d3c73d 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -1102,8 +1102,19 @@ function getGameSelleRatioByPromote($promoteId = null, $gameId = null) if (empty($promoteId) || empty($gameId)) { return false; } - $map['promote_id'] = intval($promoteId); - $map['game_id'] = intval($gameId); + $promoteId = intval($promoteId); + $gameId = intval($gameId); + $promote = M('promote', 'tab_')->find($promoteId); + if (empty($promote)) { + return false; + } + if ($promote['level'] != 1) { + $promoteId = explode('/', trim($promote['chain'], '/'))[0]; + $promoteId = intval($promoteId); + } + + $map['promote_id'] = $promoteId; + $map['game_id'] = $gameId; $promoteGameRatio = M('promote_game_ratio', 'tab_')->where($map)->find(); if (empty($promoteGameRatio) || $promoteGameRatio['status'] != 1) { From 75faf37260529c497167a4c5ed7dfee2f37d2e6c Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 20 Dec 2019 15:11:09 +0800 Subject: [PATCH 3/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=AE=A1=E7=90=86>=E5=85=AC?= =?UTF-8?q?=E4=BC=9A=E5=88=86=E6=88=90=E7=AE=A1=E7=90=86--=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Common/Common/extend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index b34d3c73d..8d9b15e40 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -1081,7 +1081,7 @@ function is_check_account($account){ } //获取游戏cp比例 -function getGameSelleRatio($gameId = null, $promoteId = null, $field = 'id') +function getGameSelleRatio($promoteId = null, $gameId = null, $field = 'id') { $promoteGameRatio = getGameSelleRatioByPromote($promoteId, $gameId); if ($promoteGameRatio === false) { From 116d1891a1807713f53c45805659ec03f049c24d Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 20 Dec 2019 15:16:21 +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=AE=A1=E7=90=86>=E5=85=AC?= =?UTF-8?q?=E4=BC=9A=E5=88=86=E6=88=90=E7=AE=A1=E7=90=86--=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Common/Common/extend.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index 8d9b15e40..476064d0d 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -1102,15 +1102,17 @@ function getGameSelleRatioByPromote($promoteId = null, $gameId = null) if (empty($promoteId) || empty($gameId)) { return false; } + $promoteId = intval($promoteId); $gameId = intval($gameId); $promote = M('promote', 'tab_')->find($promoteId); + if (empty($promote)) { return false; } if ($promote['level'] != 1) { - $promoteId = explode('/', trim($promote['chain'], '/'))[0]; - $promoteId = intval($promoteId); + $chain = explode('/', trim($promote['chain'], '/')); + $promoteId = empty($chain[0]) ? 0 : intval($chain[0]); } $map['promote_id'] = $promoteId;