feat(catalog): add is_enabled attribute to categories and filter items accordingly
This commit is contained in:
@@ -49,6 +49,15 @@ class FeaturedGroupService
|
||||
{
|
||||
$query = CatalogItem::query()
|
||||
->where('catalog_items.tenant_code', $featuredGroup->tenant_code)
|
||||
->where(function (Builder $query): void {
|
||||
$query
|
||||
->whereDoesntHave('category')
|
||||
->orWhereHas(
|
||||
'category',
|
||||
fn (Builder $categoryQuery): Builder => $categoryQuery
|
||||
->where('is_enabled', true),
|
||||
);
|
||||
})
|
||||
->with([
|
||||
'inventory',
|
||||
'attachments',
|
||||
|
||||
Reference in New Issue
Block a user