KoVaLsKy 59 Опубликовано 13 октября, 2015 Жалоба Share Опубликовано 13 октября, 2015 Саш, в includes\modules\default.php поменяй if (isset ($_GET['manufacturers_id'])) { $filterlist_sql = "select distinct p.manufacturers_id, p.label_id, c.categories_id as id, cd.categories_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd where p.products_status = '1' and c.categories_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '".(int) $_SESSION['languages_id']."' and p.manufacturers_id = '".(int) $_GET['manufacturers_id']."' group by p.manufacturers_id"; } else { if (PRODUCT_LIST_RECURSIVE == 'true') { $filterlist_sql = "select distinct p.manufacturers_id, p.label_id, m.manufacturers_id as id, m.manufacturers_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_CATEGORIES." c,".TABLE_MANUFACTURERS." m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and (p2c.categories_id = '".$current_category_id."' AND p2c.categories_id = c.categories_id OR p2c.categories_id = c.categories_id AND c.parent_id = '".$current_category_id."') group by p.manufacturers_id"; } else { $filterlist_sql = "select distinct m.manufacturers_id as id, p.label_id, m.manufacturers_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_MANUFACTURERS." m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '".$current_category_id."' group by p.manufacturers_id"; } } на if (isset ($_GET['manufacturers_id'])) { $filterlist_sql = "select distinct p.manufacturers_id, c.categories_id as id, cd.categories_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd where p.products_status = '1' and c.categories_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '".(int) $_SESSION['languages_id']."' and p.manufacturers_id = '".(int) $_GET['manufacturers_id']."' group by p.manufacturers_id"; } else { if (PRODUCT_LIST_RECURSIVE == 'true') { $filterlist_sql = "select distinct p.manufacturers_id, m.manufacturers_id as id, m.manufacturers_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_CATEGORIES." c,".TABLE_MANUFACTURERS." m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and (p2c.categories_id = '".$current_category_id."' AND p2c.categories_id = c.categories_id OR p2c.categories_id = c.categories_id AND c.parent_id = '".$current_category_id."') group by p.manufacturers_id"; } else { $filterlist_sql = "select distinct m.manufacturers_id as id, m.manufacturers_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_MANUFACTURERS." m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '".$current_category_id."' group by p.manufacturers_id"; } } из за p.label_id distinct не срабатывал корректно SQL запрос (выдавало дубли) Ссылка на сообщение Поделиться на другие сайты
support 447 Опубликовано 13 октября, 2015 Жалоба Share Опубликовано 13 октября, 2015 Спасибо, внёс правку в текущий код. Ссылка на сообщение Поделиться на другие сайты
Рекомендуемые сообщения