WIP
This commit is contained in:
@@ -102,11 +102,13 @@ class FilterController extends Controller
|
||||
->distinct('products.id')
|
||||
->pluck('products.id');
|
||||
|
||||
return Category::where('is_visible', true)->ordered()->join('product_has_relations', 'categories.id', '=', 'product_has_relations.productable_id')
|
||||
->where('product_has_relations.productable_type', '=', 'category')
|
||||
->whereIntegerInRaw('product_has_relations.product_id', $products)
|
||||
->get(['id', 'parent_id', 'name'])
|
||||
->unique('categories.id');
|
||||
return Category::where('is_visible', true)
|
||||
->ordered()
|
||||
->join('product_has_relations', 'categories.id', '=', 'product_has_relations.productable_id')
|
||||
->where('product_has_relations.productable_type', '=', 'category')
|
||||
->whereIntegerInRaw('product_has_relations.product_id', $products)
|
||||
->get(['categories.id', 'categories.parent_id', 'categories.name'])
|
||||
->unique('categories.id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,9 @@ class OrderPaymentController extends Controller
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
return response()->rest(
|
||||
PaymentType::all(['id', 'name'])
|
||||
PaymentType::query()
|
||||
->where('is_enabled', true)
|
||||
->get(['id', 'name', 'is_enabled'])
|
||||
->map(fn ($paymentType) => [
|
||||
'id' => $paymentType->id,
|
||||
'name' => $paymentType->name,
|
||||
|
||||
Reference in New Issue
Block a user