// Context part 27
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7812 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -217,15 +217,13 @@ class ProductComment extends ObjectModel
|
||||
*/
|
||||
public static function getByValidate($validate = '0', $deleted = false)
|
||||
{
|
||||
global $cookie;
|
||||
|
||||
return (Db::getInstance()->ExecuteS('
|
||||
SELECT pc.`id_product_comment`, pc.`id_product`, IF(c.id_customer, CONCAT(c.`firstname`, \' \', c.`lastname`), pc.customer_name) customer_name, pc.`content`, pc.`grade`, pc.`date_add`, pl.`name`
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = pc.`id_customer`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = pc.`id_product`)
|
||||
WHERE pc.`validate` = '.(int)($validate).'
|
||||
AND pl.`id_lang` = '.(int)($cookie->id_lang).'
|
||||
AND pl.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
ORDER BY pc.`date_add` DESC'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user