active brands
This commit is contained in:
parent
c6922056a3
commit
8b3ae7ee5b
|
|
@ -29,7 +29,11 @@ class Categories extends Controller
|
|||
}
|
||||
|
||||
public function filters($id){
|
||||
$category = $this->categoryRepository->with(['filterableAttributes','brands','children'])->find($id);
|
||||
$category = $this->categoryRepository->with(['filterableAttributes','children',
|
||||
'brands' => function ($q){
|
||||
$q->where('status',1);
|
||||
} ])
|
||||
->find($id);
|
||||
|
||||
if($category)
|
||||
return response([
|
||||
|
|
|
|||
|
|
@ -90,7 +90,8 @@ class BrandRepository extends Repository
|
|||
$limit = request()->get('limit') ?? 10;
|
||||
$page = request()->get('page') ?? 1;
|
||||
|
||||
return $query->orderBy('position', 'ASC')
|
||||
return $query->where('status',1)
|
||||
->orderBy('position', 'ASC')
|
||||
->skip(($page-1) * $limit)
|
||||
->take($limit)
|
||||
->get();
|
||||
|
|
|
|||
Loading…
Reference in New Issue