// 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:
tDidierjean
2011-07-29 14:29:57 +00:00
parent 35748d1b8f
commit 5d090a25b3
66 changed files with 532 additions and 813 deletions
+1 -3
View File
@@ -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'));
}