Merge pull request #6714 from jitendra-webkul/master
Optimized getting category filterable attributes
This commit is contained in:
commit
f54172734e
|
|
@ -136,7 +136,7 @@ class AttributeRepository extends Repository
|
|||
*/
|
||||
public function getFilterAttributes()
|
||||
{
|
||||
return $this->model->where('is_filterable', 1)->with('options')->get();
|
||||
return $this->model->with(['options', 'options.translations'])->where('is_filterable', 1)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -90,6 +90,8 @@ class Category extends TranslatableModel implements CategoryContract
|
|||
'options' => function ($query) {
|
||||
$query->orderBy('sort_order');
|
||||
},
|
||||
'translations',
|
||||
'options.translations',
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue