mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-10 01:16:12 +00:00
fix sms conversation query
This commit is contained in:
parent
cc13e01fe9
commit
02ba89f6aa
@ -67,14 +67,15 @@ class SmsMapper extends Mapper {
|
||||
|
||||
public function getAllMessagesForPhoneNumber ($userId, $phoneNumber) {
|
||||
$query = \OC_DB::prepare('SELECT sms_date, sms_msg, sms_type FROM ' .
|
||||
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_mailbox IN (?,?)');
|
||||
$result = $query->execute(array($userId, 0, 1));
|
||||
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_address = ? ' .
|
||||
'AND sms_mailbox IN (?,?)');
|
||||
$result = $query->execute(array($userId, $phoneNumber, 0, 1));
|
||||
|
||||
$messageList = array();
|
||||
while($row = $result->fetchRow()) {
|
||||
array_push($messageList[$row["sms_date"]], $row);
|
||||
}
|
||||
sort($messageList);
|
||||
ksort($messageList);
|
||||
return $messageList;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user