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

Prepare another query

This commit is contained in:
Loic Blot 2018-04-10 08:45:19 +02:00
parent 0bac525826
commit 8a0580e7c4
No known key found for this signature in database
GPG Key ID: EFAA458E8C153987

View File

@ -183,6 +183,19 @@ class SmsMapper extends Mapper {
$query = \OCP\DB::prepare('SELECT sms_address, sms_date, sms_msg, sms_type, sms_mailbox FROM ' .
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_date > ? ORDER BY sms_date', (int) $limit);
$result = $query->execute(array($userId, $start));
// $qb = $this->db->getQueryBuilder();
// $qb->select('sms_address, sms_date, sms_msg, sms_type, sms_mailbox')
// ->from('ocsms_smsdatas')
// ->where($qb->expr()->andX(
// $qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
// $qb->expr()->gt('sms_date', $qb->createNamedParameter($start))
// )
// )
// ->orderBy('sms_date');
// $result = $qb->execute();
// How to do limit ?
while ($row = $result->fetchRow()) {
$messageList[$row["sms_date"]] = array(
"address" => $row["sms_address"],