afa 6 сар өмнө
parent
commit
e404774e26

+ 2 - 2
application/api/controller/Product.php

@@ -71,7 +71,7 @@ class Product extends Api
         $order = 'price ASC';
         if($sort == 1) $order = 'price desc';
         $map['a.status'] = $productTransfer::Normal;
-        if(!empty($type_id)) $map['a.type_id'] = $type_id;
+        if(!empty($type_id)) $map['b.type_id'] = $type_id;
         if(!empty($key_val)) $map['b.'.$this->lan.'_name'] = ['like', '%'.$key_val.'%'];
      
         $list = $productTransfer
@@ -104,7 +104,7 @@ class Product extends Api
         if($sort == 1) $order = 'price DESC';
         if($sort == 2) $order = 'price ASC';
         $map['a.status'] = $productTransfer::Normal;
-        if(!empty($type_id)) $map['a.type_id'] = $type_id;
+        if(!empty($type_id)) $map['b.type_id'] = $type_id;
         if(!empty($key_val)) $map['b.'.$this->lan.'_name'] = ['like', '%'.$key_val.'%'];
         $list = $productTransfer->alias('a')
             ->join("product_list b", "a.product_id = b.id", "left")