This commit is contained in:
Mekan1206
2026-05-02 12:55:20 +05:00
parent 005b428cf1
commit 6617c8bd27
4 changed files with 17 additions and 17 deletions

View File

@@ -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');
}
/**

View File

@@ -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,