[+] BO : now you can sync imap mailbox with the Customer Service (SAV)
This commit is contained in:
@@ -34,6 +34,7 @@ class CustomerMessageCore extends ObjectModel
|
||||
public $file_name;
|
||||
public $ip_address;
|
||||
public $user_agent;
|
||||
public $private;
|
||||
public $date_add;
|
||||
|
||||
protected $table = 'customer_message';
|
||||
@@ -52,11 +53,12 @@ class CustomerMessageCore extends ObjectModel
|
||||
$fields['file_name'] = pSQL($this->file_name);
|
||||
$fields['ip_address'] = (int)($this->ip_address);
|
||||
$fields['user_agent'] = pSQL($this->user_agent);
|
||||
$fields['private'] = pSQL($this->private);
|
||||
$fields['date_add'] = pSQL($this->date_add);
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public static function getMessagesByOrderId($id_order)
|
||||
public static function getMessagesByOrderId($id_order, $private = true)
|
||||
{
|
||||
return Db::getInstance()->ExecuteS('
|
||||
SELECT cm.*, c.`firstname` AS cfirstname, c.`lastname` AS clastname, e.`firstname` AS efirstname, e.`lastname` AS elastname, (COUNT(cm.id_customer_message) = 0 AND ct.id_customer != 0) AS is_new_for_me
|
||||
@@ -64,7 +66,7 @@ class CustomerMessageCore extends ObjectModel
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer_thread` ct ON ct.`id_customer_thread` = cm.`id_customer_thread`
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` c ON ct.`id_customer` = c.`id_customer`
|
||||
LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = cm.`id_employee`
|
||||
WHERE ct.id_order = '.(int)$id_order.'
|
||||
WHERE ct.id_order = '.(int)$id_order.' AND '.(!$private ? 'cm.`private` = 0' : '').'
|
||||
GROUP BY cm.id_customer_message
|
||||
ORDER BY cm.date_add DESC');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user