소스 검색

分类查询

afa 7 달 전
부모
커밋
e404774e26
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      application/api/controller/Product.php

+ 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")