mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-06-07 09:54:27 +02:00
[various] Replace references to UTC_TIMESTAMP in SQL queries with a DateTimeFormat generated parameter
This commit is contained in:
parent
0de0faa44f
commit
fd29c1a074
2 changed files with 11 additions and 11 deletions
|
@ -48,8 +48,8 @@ function testdrive_register_account($a,$b) {
|
|||
|
||||
|
||||
function testdrive_cron($a,$b) {
|
||||
$users = DBA::selectToArray('user', [], ["`account_expires_on` < UTC_TIMESTAMP() + INTERVAL ? DAY AND `expire_notification_sent` <= ?",
|
||||
5, DBA::NULL_DATETIME]);
|
||||
$users = DBA::selectToArray('user', [], ["`account_expires_on` < ? AND `expire_notification_sent` <= ?",
|
||||
DateTimeFormat::utc('now + 5 days'), DBA::NULL_DATETIME]);
|
||||
foreach($users as $rr) {
|
||||
DI::notify()->createFromArray([
|
||||
'type' => Notification\Type::SYSTEM,
|
||||
|
@ -63,7 +63,7 @@ function testdrive_cron($a,$b) {
|
|||
DBA::update('user', ['expire_notification_sent' => DateTimeFormat::utcNow()], ['uid' => $rr['uid']]);
|
||||
}
|
||||
|
||||
$users = DBA::selectToArray('user', [], ["`account_expired` AND `account_expires_on` < UTC_TIMESTAMP() - INTERVAL ? DAY", 5]);
|
||||
$users = DBA::selectToArray('user', [], ["`account_expired` AND `account_expires_on` < ?", DateTimeFormat::utc('now - 5 days')]);
|
||||
foreach($users as $rr) {
|
||||
User::remove($rr['uid']);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue