//oups part 2
This commit is contained in:
@@ -36,6 +36,7 @@ class CustomerMessageCore extends ObjectModel
|
||||
public $user_agent;
|
||||
public $private;
|
||||
public $date_add;
|
||||
public $read;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
@@ -52,6 +53,7 @@ class CustomerMessageCore extends ObjectModel
|
||||
'user_agent' => array('type' => self::TYPE_STRING),
|
||||
'private' => array('type' => self::TYPE_INT),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'read' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool')
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -72,15 +72,17 @@ class CustomerThreadCore extends ObjectModel
|
||||
return (parent::delete());
|
||||
}
|
||||
|
||||
public static function getCustomerMessages($id_customer)
|
||||
public static function getCustomerMessages($id_customer, $read = null)
|
||||
{
|
||||
return Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
$sql = 'SELECT *
|
||||
FROM '._DB_PREFIX_.'customer_thread ct
|
||||
LEFT JOIN '._DB_PREFIX_.'customer_message cm
|
||||
ON ct.id_customer_thread = cm.id_customer_thread
|
||||
WHERE id_customer = '.(int)$id_customer
|
||||
);
|
||||
WHERE id_customer = '.(int)$id_customer;
|
||||
if (!is_null($read))
|
||||
$sql .= ' AND cm.`read` = '.(int)$read;
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public static function getIdCustomerThreadByEmailAndIdOrder($email, $id_order)
|
||||
|
||||
Reference in New Issue
Block a user