chengwl 1 день назад
Родитель
Сommit
2c1f66cd8d

+ 1 - 1
packages/Webkul/Admin/src/Http/Requests/ProductForm.php

@@ -73,7 +73,7 @@ class ProductForm extends FormRequest
         $this->product = $this->productRepository->find($this->id);
         $this->product = $this->productRepository->find($this->id);
 
 
         $this->rules = array_merge($this->product->getTypeInstance()->getTypeValidationRules(), [
         $this->rules = array_merge($this->product->getTypeInstance()->getTypeValidationRules(), [
-            'sku'                  => ['required', 'unique:products,sku,'.$this->id, new Slug],
+            'sku'                  => ['required', 'unique:products,sku,'.$this->id],
             'url_key'              => ['required', new ProductCategoryUniqueSlug('products', $this->id)],
             'url_key'              => ['required', new ProductCategoryUniqueSlug('products', $this->id)],
             'images.files.*'       => ['nullable', 'mimes:bmp,jpeg,jpg,png,webp'],
             'images.files.*'       => ['nullable', 'mimes:bmp,jpeg,jpg,png,webp'],
             'images.positions.*'   => ['nullable', 'integer'],
             'images.positions.*'   => ['nullable', 'integer'],

+ 16 - 2
packages/Webkul/BagistoApi/src/State/CustomerOrderProvider.php

@@ -105,7 +105,14 @@ class CustomerOrderProvider implements ProviderInterface
      */
      */
     private function baseOrderDetailsQuery()
     private function baseOrderDetailsQuery()
     {
     {
-        return CustomerOrder::with(['items', 'addresses', 'payment', 'shipments.items', 'shipments.shippingAddress']);
+        return CustomerOrder::with([
+            'items.product.images',
+            'items.children.product.images',
+            'addresses',
+            'payment',
+            'shipments.items',
+            'shipments.shippingAddress',
+        ]);
     }
     }
 
 
     private function resolveOrderId(array $uriVariables): int
     private function resolveOrderId(array $uriVariables): int
@@ -185,7 +192,14 @@ class CustomerOrderProvider implements ProviderInterface
         $args = $context['args'] ?? [];
         $args = $context['args'] ?? [];
         $filters = $context['filters'] ?? [];
         $filters = $context['filters'] ?? [];
 
 
-        $query = CustomerOrder::with(['items', 'addresses', 'payment', 'shipments.items', 'shipments.shippingAddress'])
+        $query = CustomerOrder::with([
+            'items.product.images',
+            'items.children.product.images',
+            'addresses',
+            'payment',
+            'shipments.items',
+            'shipments.shippingAddress',
+        ])
             ->where('customer_id', $customer->id)
             ->where('customer_id', $customer->id)
             ->where('customer_type', Customer::class);
             ->where('customer_type', Customer::class);