From acba9f6689bdfa00d5fa67204ac8e8a77eddf2a8 Mon Sep 17 00:00:00 2001 From: merdan Date: Tue, 3 May 2022 16:53:12 +0500 Subject: [PATCH] category indexes --- packages/Sarga/API/Http/Controllers/SearchController.php | 2 +- packages/Sarga/API/Http/Resources/Catalog/Suggestion.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/Sarga/API/Http/Controllers/SearchController.php b/packages/Sarga/API/Http/Controllers/SearchController.php index caa36bbbb..1d44fe57e 100644 --- a/packages/Sarga/API/Http/Controllers/SearchController.php +++ b/packages/Sarga/API/Http/Controllers/SearchController.php @@ -57,7 +57,7 @@ class SearchController extends Controller $key = request('search'); $categories = CategoryTranslationProxy::modelClass()::where('name', 'like', '%'.$key.'%') ->distinct() - ->select('category_id as id','name') + ->select('category_id as id','name','description') ->groupBy('category_id') ->take(10) ->orderBy('name') diff --git a/packages/Sarga/API/Http/Resources/Catalog/Suggestion.php b/packages/Sarga/API/Http/Resources/Catalog/Suggestion.php index a3db05aa7..dedef3c4d 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/Suggestion.php +++ b/packages/Sarga/API/Http/Resources/Catalog/Suggestion.php @@ -18,6 +18,7 @@ class Suggestion extends JsonResource 'id' => $this->product_id ?? $this->id, 'type' => $this->suggestion_type, 'name' => $this->name, + 'description' => $this->description, ]; } } \ No newline at end of file