bebeboutik/override/classes/CustomerThread.php

41 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2016-11-02 17:03:58 +01:00
<?php
class CustomerThread extends CustomerThreadCore
{
public function printCountry($value, $params)
{
switch ($value) {
case '1':
$flag = 17;
break;
case '2':
$flag = 8;
break;
case '3':
$flag = 6;
break;
case '4':
$flag = 1;
break;
case '5':
$flag = 10;
break;
default:
$flag = 8;
break;
}
return '<img src="/img/flags/'.(int) $flag.'.png" alt="" />';
}
public static function getCustomerConversations($id_customer, $order = 'ASC', $except_id = false)
{
return Db::getInstance()->ExecuteS('
SELECT DISTINCT ct.* 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)
.($except_id?' AND ct.id_customer_thread !='.(int)$except_id:'')
.' ORDER BY cm.date_add '.$order
);
}
2016-11-02 17:03:58 +01:00
}