Added: The customer messages sent from the contact page will now also be segregated according to the contact selected by the customer
This commit is contained in:
@@ -140,14 +140,15 @@ class CustomerThreadCore extends ObjectModel
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public static function getIdCustomerThreadByEmailAndIdOrder($email, $id_order)
|
||||
public static function getIdCustomerThreadByEmailAndIdOrder($email, $id_order, $id_contact = false)
|
||||
{
|
||||
return Db::getInstance()->getValue('
|
||||
SELECT cm.id_customer_thread
|
||||
FROM '._DB_PREFIX_.'customer_thread cm
|
||||
WHERE cm.email = \''.pSQL($email).'\'
|
||||
AND cm.id_shop = '.(int)Context::getContext()->shop->id.'
|
||||
AND cm.id_order = '.(int)$id_order
|
||||
AND cm.id_order = '.(int)$id_order.' '.
|
||||
(($id_contact) ? ' AND cm.id_contact='.(int) $id_contact : ' ')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class ContactControllerCore extends FrontController
|
||||
SELECT cm.id_customer_thread FROM '._DB_PREFIX_.'customer_thread cm
|
||||
WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND cm.id_shop = '.(int)$this->context->shop->id.' AND token = \''.pSQL(Tools::getValue('token')).'\'')
|
||||
) || (
|
||||
$id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($from, $id_order)
|
||||
$id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($from, $id_order, $id_contact)
|
||||
))) {
|
||||
$fields = Db::getInstance()->executeS('
|
||||
SELECT cm.id_customer_thread, cm.id_contact, cm.id_customer, cm.id_order, cm.id_product, cm.email
|
||||
|
||||
Reference in New Issue
Block a user