mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-07-06 11:40:16 +02:00
More accurate premium duration calculation.
Dont skimp on the hours on the last day the premium expires.
This commit is contained in:
parent
a531a18fad
commit
78d35bb441
@ -1125,13 +1125,13 @@ function user_account_add_premdays($accid, $days) {
|
|||||||
} else {
|
} else {
|
||||||
mysql_update(" UPDATE `accounts`
|
mysql_update(" UPDATE `accounts`
|
||||||
SET `premdays` = `premdays`+{$days}
|
SET `premdays` = `premdays`+{$days}
|
||||||
,`lastday` = GREATEST(`lastday`,UNIX_TIMESTAMP(CURDATE())) + ({$days} * 86400)
|
,`lastday` = GREATEST(`lastday`,UNIX_TIMESTAMP()) + ({$days} * 86400)
|
||||||
WHERE `id`='{$accid}'
|
WHERE `id`='{$accid}'
|
||||||
");
|
");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mysql_update(" UPDATE `accounts`
|
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}';
|
WHERE `id`='{$accid}';
|
||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user