Fixed the wrong function call for the customer messages in AdminOrdersController, Added definition for the CustomerThread::getCustomerMessages() function
This commit is contained in:
@@ -37,6 +37,7 @@ class CustomerMessageCore extends ObjectModel
|
||||
public $date_add;
|
||||
public $date_upd;
|
||||
public $read;
|
||||
|
||||
const QLO_CUSTOMER_MESSAGE_BY_EMPLOYEE = 1;
|
||||
const QLO_CUSTOMER_MESSAGE_BY_CUSTOMER = 2;
|
||||
|
||||
|
||||
@@ -120,6 +120,16 @@ class CustomerThreadCore extends ObjectModel
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves customer messages based on specified conditions.
|
||||
*
|
||||
* @param int $id_customer Customer ID.
|
||||
* @param bool|null $read Return read (true), unread (false), or all messages (null).
|
||||
* @param int|null $id_order Filter messages by order ID.
|
||||
* @param int|null $messageBy Filter messages by sender (employees, customer, or both).
|
||||
*
|
||||
* @return array List of messages matching the conditions.
|
||||
*/
|
||||
public static function getCustomerMessages($id_customer, $read = null, $id_order = null, $messageBy = null)
|
||||
{
|
||||
$sql = 'SELECT *
|
||||
|
||||
@@ -2431,7 +2431,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper->title = $this->l('Messages');
|
||||
$helper->tooltip = $this->l('Messages is the number of customer messages for this order.');
|
||||
$helper->href = $this->context->link->getAdminLink('AdminCustomerThreads').'&id_order='.$objOrder->id;
|
||||
$helper->value = count(CustomerThread::getCustomerMessages($objOrder->id_customer, null, $objOrder->id, CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_EMPLOYEE));
|
||||
$helper->value = count(CustomerThread::getCustomerMessages($objOrder->id_customer, null, $objOrder->id, CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_CUSTOMER));
|
||||
$this->kpis[] = $helper;
|
||||
|
||||
$objHotelBookingDetail = new HotelBookingDetail();
|
||||
|
||||
Reference in New Issue
Block a user