From 2013f1a10e8f6b6a991330bc021ddf0de1604ddc Mon Sep 17 00:00:00 2001 From: Sergey Sysa Date: Sun, 26 Jul 2015 16:58:24 +1000 Subject: [PATCH] Update Brands.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit у брендов нет visible в БД --- api/Brands.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/api/Brands.php b/api/Brands.php index 6af25ad..30a50e5 100755 --- a/api/Brands.php +++ b/api/Brands.php @@ -21,12 +21,8 @@ class Brands extends Simpla */ public function get_brands($filter = array()) { - $brands = array(); $category_id_filter = ''; - $visible_filter = ''; - if(isset($filter['visible'])) - $visible_filter = $this->db->placehold('AND p.visible=?', intval($filter['visible'])); - + if(!empty($filter['category_id'])) $category_id_filter = $this->db->placehold("LEFT JOIN __products p ON p.brand_id=b.id LEFT JOIN __products_categories pc ON p.id = pc.product_id WHERE pc.category_id in(?@) $visible_filter", (array)$filter['category_id']); @@ -132,4 +128,4 @@ public function delete_image($brand_id) } } -} \ No newline at end of file +}