2
0
mirror of https://github.com/Znote/ZnoteAAC.git synced 2025-05-17 03:19:22 +02:00

More accurate premium duration calculation.

Dont skimp on the hours on the last day the premium expires.
This commit is contained in:
Znote 2022-01-29 23:01:03 +01:00
parent a531a18fad
commit 78d35bb441

@ -1125,13 +1125,13 @@ function user_account_add_premdays($accid, $days) {
} else {
mysql_update(" UPDATE `accounts`
SET `premdays` = `premdays`+{$days}
,`lastday` = GREATEST(`lastday`,UNIX_TIMESTAMP(CURDATE())) + ({$days} * 86400)
,`lastday` = GREATEST(`lastday`,UNIX_TIMESTAMP()) + ({$days} * 86400)
WHERE `id`='{$accid}'
");
}
} else {
mysql_update(" UPDATE `accounts`
SET `premium_ends_at` = GREATEST(`premium_ends_at`, UNIX_TIMESTAMP(CURDATE())) + ({$days} * 86400)
SET `premium_ends_at` = GREATEST(`premium_ends_at`, UNIX_TIMESTAMP()) + ({$days} * 86400)
WHERE `id`='{$accid}';
");
}