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