ZnoteAAC icon indicating copy to clipboard operation
ZnoteAAC copied to clipboard

[V2] CHANGE UNIX_TIMESTAMP(CURDATE()) TO UNIX_TIMESTAMP(NOW())

Open mano368 opened this issue 2 years ago • 0 comments

Hello,

When making a test purchase, I verified that when using CURDATE(), only 5 hours of premium was added to the account, instead of 24 hours. Switching to NOW() seems to have fixed the problem by adding 24 hours!

Engine->Function->users.php

// Add additional premium days to account id
function user_account_add_premdays($accid, $days) {
	$accid = (int)$accid;
	$days = (int)$days;
	mysql_update("
		UPDATE `accounts` 
		SET `premium_ends_at` = GREATEST(`premium_ends_at`, UNIX_TIMESTAMP(NOW())) + ({$days} * 86400)
		WHERE `id`='{$accid}';
	");
}

If this error has to do with the webserver, please disregard and I apologize in advance.

mano368 avatar Jun 06 '22 04:06 mano368