1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-10 09:26:15 +00:00

Fix #55 issue. NOW() function doesn't work on all backends

This commit is contained in:
Loic Blot 2015-03-02 13:58:59 +01:00
parent ff3c3e58ef
commit 98933860e8

View File

@ -263,12 +263,13 @@ class SmsMapper extends Mapper {
$userId, (int) $sms["_id"]
));
}
$now = date("Y-m-d H:i:s");
$query = \OCP\DB::prepare('INSERT INTO *PREFIX*ocsms_smsdatas ' .
'(user_id, added, lastmodified, sms_flags, sms_date, sms_id,' .
'sms_address, sms_msg, sms_mailbox, sms_type) VALUES ' .
'(?,?,?,?,?,?,?,?,?,?)');
$result = $query->execute(array(
$userId, "NOW()", "NOW()", $smsFlags,
$userId, $now, $now, $smsFlags,
$sms["date"], (int) $sms["_id"],
$sms["address"], $sms["body"], (int) $sms["mbox"],
(int) $sms["type"]