2
0
mirror of https://github.com/Znote/ZnoteAAC.git synced 2025-05-02 20:29:21 +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 22:54:29 +01:00
parent 7fb0916f57
commit c2cdf5f3bf

@ -889,7 +889,7 @@ function user_account_add_premdays($accid, $days) {
$days = (int)$days;
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}';
");
}