[-] BO : Fix SQL query when $join_category == false, pull request https://github.com/Captain-FLAM/PrestaShop/commit/d5f75c63b6e21dd87c77a027bf8dd293afb1a94f thanks @Captain-FLAM
This commit is contained in:
1 parent
abf6f0d626
commit
4aab4f88cd
1 file changed
+2
-2
@@ -175,12 +175,12 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_image` = i.`id_image` AND image_shop.`cover` = 1 AND image_shop.id_shop = '.$id_shop.')';
|
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_image` = i.`id_image` AND image_shop.`cover` = 1 AND image_shop.id_shop = '.$id_shop.')';
|
||||||
|
|
||||||
$this->_select .= 'shop.name as shopname, ';
|
$this->_select .= 'shop.name as shopname, ';
|
||||||
$this->_select .= 'MAX('.$alias_image.'.id_image) id_image, cl.name `name_category`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`, ';
|
$this->_select .= 'MAX('.$alias_image.'.id_image) id_image, cl.name `name_category`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`';
|
||||||
|
|
||||||
if ($join_category)
|
if ($join_category)
|
||||||
{
|
{
|
||||||
$this->_join .= ' INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.') ';
|
$this->_join .= ' INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.') ';
|
||||||
$this->_select .= ' cp.`position`, ';
|
$this->_select .= ' , cp.`position`, ';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_group = 'GROUP BY '.$alias.'.id_product';
|
$this->_group = 'GROUP BY '.$alias.'.id_product';
|
||||||
|
|||||||
Reference in new issue
Block a user