From 83d3939374d6340b2f815741f0a2566c57939881 Mon Sep 17 00:00:00 2001 From: merdan Date: Sat, 2 Apr 2022 12:53:56 +0500 Subject: [PATCH] superattrbt --- packages/Sarga/API/Http/Resources/Catalog/Product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/Sarga/API/Http/Resources/Catalog/Product.php b/packages/Sarga/API/Http/Resources/Catalog/Product.php index c2b3f4c23..6a54ff82a 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/Product.php +++ b/packages/Sarga/API/Http/Resources/Catalog/Product.php @@ -78,7 +78,7 @@ class Product extends JsonResource return [ 'code' => $item->code, 'value' => $this->{$item->code}, - 'name' => $item->name, + 'name' => $item->name??$item->admin_name, 'label' => $item->options->where('id',$this->{$item->code})->first()->admin_name ]; })->toArray(); @@ -87,7 +87,7 @@ class Product extends JsonResource return [ 'code' => $item->code, 'value' => $this->{$item->code}, - 'name' => $item->name, + 'name' => $item->name??$item->admin_name, 'label' => $item->options->where('id',$this->{$item->code})->first()->admin_name ]; }