diff --git a/app/controller/api/store/product/StoreMicro.php b/app/controller/api/store/product/StoreMicro.php index 8a61bb8b..d75e5a62 100644 --- a/app/controller/api/store/product/StoreMicro.php +++ b/app/controller/api/store/product/StoreMicro.php @@ -10,7 +10,9 @@ class StoreMicro extends BaseController $category_id=Db::name('merchant')->where('mer_id',$mer_id)->value('category_id'); $mer_id=Db::name('merchant')->where('category_id',$category_id)->where('type_id',13)->value('mer_id'); if($code!=''){ - $find=Db::name('store_product')->where('mer_id',$mer_id)->where('bar_code',$code)->select(); + $product_id_arr=Db::name('store_product_attr_value')->where('mer_id',$mer_id)->where('bar_code',$code)->column('product_id'); + $product_id_arr=implode(',',$product_id_arr); + $find=Db::name('store_product')->where('product_id',$product_id_arr)->select(); }else{ $find=Db::name('store_product')->where('mer_id',$mer_id)->where('store_name','like','%'.$name.'%')->select(); }