mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-15 18:24:56 +02:00
Fix premDays count in canary
This commit is contained in:
@@ -1704,6 +1704,12 @@ function getAccountIdentityColumn(): string
|
|||||||
return 'id';
|
return 'id';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isCanary(): bool
|
||||||
|
{
|
||||||
|
$vipSystemEnabled = configLua('vipSystemEnabled');
|
||||||
|
return isset($vipSystemEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
// validator functions
|
// validator functions
|
||||||
require_once SYSTEM . 'compat/base.php';
|
require_once SYSTEM . 'compat/base.php';
|
||||||
|
|
||||||
|
@@ -449,6 +449,11 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
|||||||
return max($ret, 0);
|
return max($ret, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isCanary() && isset($this->data['lastday'])) {
|
||||||
|
$ret = ceil(($this->data['lastday'] - time()) / 86400);
|
||||||
|
return $ret > 0 ? $ret : 0;
|
||||||
|
}
|
||||||
|
|
||||||
if($this->data['premdays'] == 0) {
|
if($this->data['premdays'] == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user