添加云仓关键词搜索

This commit is contained in:
luofei 2024-01-23 11:59:47 +08:00
parent 908968961c
commit 8890972390

View File

@ -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,');