#4237 The main category does not appear if the subcategory is not attached.

This commit is contained in:
Muammer Top 2021-06-28 14:14:40 +03:00
parent 668f01bab2
commit f987be6bc2

View File

@ -61,9 +61,11 @@ class CategoryRepository extends EntryRepository implements CategoryRepositoryIn
) )
->leftJoin((DB::raw($dBName . ' c2')), DB::raw('c2.parent_category_id'), '=', DB::raw('c1.id')) ->leftJoin((DB::raw($dBName . ' c2')), DB::raw('c2.parent_category_id'), '=', DB::raw('c1.id'))
->leftJoin((DB::raw($dBNamet . ' t1')), DB::raw('c1.id'), '=', DB::raw('t1.entry_id')) ->leftJoin((DB::raw($dBNamet . ' t1')), DB::raw('c1.id'), '=', DB::raw('t1.entry_id'))
->leftJoin((DB::raw($dBNamet . ' t2')), DB::raw('c2.id'), '=', DB::raw('t2.entry_id')) ->leftJoin((DB::raw($dBNamet . ' t2')), function ($join) {
$join->on(DB::raw('c2.id'), '=', DB::raw('t2.entry_id'))
->where(DB::raw('t2.locale'), Request()->session()->get('_locale', setting_value('streams::default_locale')));
})
->where(DB::raw('t1.locale'), Request()->session()->get('_locale', setting_value('streams::default_locale'))) ->where(DB::raw('t1.locale'), Request()->session()->get('_locale', setting_value('streams::default_locale')))
->where(DB::raw('t2.locale'), Request()->session()->get('_locale', setting_value('streams::default_locale')))
->where(DB::raw("c1.deleted_at"), NULL) ->where(DB::raw("c1.deleted_at"), NULL)
->where(DB::raw("c2.deleted_at"), NULL) ->where(DB::raw("c2.deleted_at"), NULL)
->whereNull(DB::raw("c1.parent_category_id")) ->whereNull(DB::raw("c1.parent_category_id"))