From 2efa1638ca9acccaca2065cb8934142d5e77b7bd Mon Sep 17 00:00:00 2001 From: alkadoHs Date: Thu, 15 Feb 2024 10:07:10 +0300 Subject: [PATCH] deperndant select perf. fix --- app/Filament/Resources/OrderResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Filament/Resources/OrderResource.php b/app/Filament/Resources/OrderResource.php index 6211520..d2007a0 100644 --- a/app/Filament/Resources/OrderResource.php +++ b/app/Filament/Resources/OrderResource.php @@ -140,7 +140,7 @@ function () { return $set('price', $state == 'R' ? VendorProduct::with('product.mainProduct')->where('id',$get('product_id'))->first()->product->mainProduct?->retail_price?? 0 : VendorProduct::with('product.mainProduct')->where('id', $get('product_id'))->first()->product->mainProduct?->whole_price?? 0); - return $set('price', $state == 'R' ? Product::find($get('product_id'))->mainProduct?->retail_price?? 0 : + return $set('price', $state == 'R' ? Product::with('mainProduct')->where('id',$get('product_id'))->first()->mainProduct?->retail_price?? 0 : Product::find($get('product_id'))->mainProduct?->whole_price?? 0); }) ->required(),