#1841 Cat selection bug with language

This commit is contained in:
Diatrex 2020-07-27 12:33:29 +03:00
parent 3f3806f2b2
commit dd6469b1d1

View File

@ -50,14 +50,8 @@ class CategoryRepository extends EntryRepository implements CategoryRepositoryIn
public function getSubCatById($id)
{
$orderBy = $this->model->getParentsCount($id) >= 1 ? 'name' : 'sort_order';
return $this->model->newQuery()
->join('cats_category_translations', 'cats_category.id', '=', 'cats_category_translations.entry_id')
->where('cats_category_translations.locale', config('app.locale'))
->where('parent_category_id', $id)
->where('deleted_at', null)
->select('cats_category.*')
->orderBy($orderBy)
->get();
}