修复seach_bar_code查询错误

This commit is contained in:
mkm 2023-05-26 14:51:57 +08:00
parent d651d826d1
commit 0f827e0108

View File

@ -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();
}