add cookie consent, change search for product_type empty
This commit is contained in:
@@ -11,13 +11,17 @@ class SearchController extends Controller
|
||||
{
|
||||
public function search(Request $request)
|
||||
{
|
||||
$data = $request->input();
|
||||
$data['product_type'] = 'botanic';
|
||||
$articles = Searches::getResults($request->input());
|
||||
$data = [
|
||||
'articles' => $articles,
|
||||
'articles_count' => $articles ? count($articles) : 0,
|
||||
'search' => $request->input(),
|
||||
'product_type' => $request->input('product_type'),
|
||||
'search' => $data,
|
||||
'product_type' => $data['product_type'],
|
||||
];
|
||||
// dump($data);
|
||||
// exit;
|
||||
return view('Shop.Search.results', $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,22 +89,22 @@ class Article extends Model implements HasMedia
|
||||
|
||||
public function scopeByAutocomplete($query, $str)
|
||||
{
|
||||
return $query->where($this->table . '.name', 'LIKE', "%${str}%");
|
||||
return $query->where($this->table . '.name', 'LIKE', '%' . $str .'%');
|
||||
}
|
||||
|
||||
public function scopeSearch($query, $str)
|
||||
{
|
||||
return $query->where($this->table . '.name', 'LIKE', "%${str}%");
|
||||
return $query->where($this->table . '.name', 'LIKE', '%' . $str .'%');
|
||||
}
|
||||
|
||||
public function scopeByArticleNature($query, $id)
|
||||
{
|
||||
return $query->where($this->table . '.article_nature_id', $id);
|
||||
return $id ? $query->where($this->table . '.article_nature_id', $id) : $query;
|
||||
}
|
||||
|
||||
public function scopeByArticleNatures($query, $ids)
|
||||
{
|
||||
return $query->whereIn($this->table . '.article_nature_id', $ids);
|
||||
return $ids ? $query->whereIn($this->table . '.article_nature_id', $ids) : $query;
|
||||
}
|
||||
|
||||
public function scopeByCategories($query, $categories_id)
|
||||
|
||||
Reference in New Issue
Block a user