breadcrumbs fix with mobile reserved not to delete

This commit is contained in:
merdan 2020-04-02 14:20:21 +05:00
parent 5a85cd945a
commit 15b304bc78
1 changed files with 7 additions and 2 deletions

View File

@ -14,7 +14,7 @@ class PublicController extends Controller
$categories = Category::select('title_tk','title_ru','id','parent_id');
if($parent_id)
$categories->children($parent_id);
$categories->children($parent_id)->orderBy('lft');
else
$categories->main();
return response()->json($categories->get());
@ -33,7 +33,12 @@ class PublicController extends Controller
->whereHas('cat_events',
function ($query) use($data){
$query->onLive($data['start'], $data['end']);
})->get();
})
->withCount(['cat_events' => function($query) use($data){
$query->onLive($data['start'], $data['end']);
}])
->orderBy('cats_event_count','desc')
->get();
return response()->json($data);