diff --git a/app/controller/api/store/product/CloudWarehouse.php b/app/controller/api/store/product/CloudWarehouse.php index fad2d374..68e6786f 100644 --- a/app/controller/api/store/product/CloudWarehouse.php +++ b/app/controller/api/store/product/CloudWarehouse.php @@ -46,6 +46,7 @@ class CloudWarehouse extends BaseController */ public function index($street_code, $page = 1, $category_id = 0, $cate_pid = 0,$cate_id = 0,$location = '') { + $keyword = $this->request->get('keyword'); if (!empty($location) && $location != ',') { [$lat, $lng] = explode(',', $location); } elseif (!empty($street_code)) { @@ -69,6 +70,9 @@ class CloudWarehouse extends BaseController if($cate_id>0){ $query->whereIn('cate_id', $cate_id); } + if (!empty($keyword)) { + $query->where('store_name', 'like', '%'. $keyword . '%'); + } $cloud_product_arr = $query->where(function($query){ $query->where('mer_labels', '') ->whereOr('mer_labels',',5,');