From 303e78256a6e99b46df1ed51e3c157198e6ba3ec Mon Sep 17 00:00:00 2001 From: elf <360197197@qq.com> Date: Mon, 13 Dec 2021 14:14:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Base/Service/PromoteService.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index d542acc49..9b3bb23d8 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -1221,6 +1221,7 @@ class PromoteService { foreach ($rules as $rule) { if ($this->isLimitRuleContains($rule, $promote) && $this->isLimitRuleEeffective($rule)) { $access = false; + break; } } return $access; @@ -1241,21 +1242,21 @@ class PromoteService { private function isLimitRuleEeffective($rule) { if ($rule['started_at'] === null && $rule['ended_at'] === null) { - return false; + return true; } elseif ($rule['started_at'] === null && $rule['ended_at'] !== null) { - if (time() < strtotime($rule['ended_at'] . ' 23:59:59')) { - return false; + if (time() <= strtotime($rule['ended_at'] . ' 23:59:59')) { + return true; } } elseif ($rule['started_at'] !== null && $rule['ended_at'] === null) { if (time() >= strtotime($rule['started_at'] . ' 00:00:00')) { - return false; + return true; } } else { if (time() >= strtotime($rule['started_at'] . ' 00:00:00') && time() < strtotime($rule['ended_at'] . ' 23:59:59')) { - return false; + return true; } } - return true; + return false; } public function getPromoteCompanyBySite($url)