mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#1841 Cat selection bug with language
This commit is contained in:
parent
3f3806f2b2
commit
dd6469b1d1
@ -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();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user