From: Vladimir Fomichev Date: Tue, 2 Sep 2025 15:17:51 +0000 (+0300) Subject: Добавляем много фото в фид X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=2710a9725adea245cd351c25c592c7af90a3bd40;p=erp24_rep%2Fyii-erp24%2F.git Добавляем много фото в фид --- diff --git a/erp24/services/MarketplaceService.php b/erp24/services/MarketplaceService.php index 5191fefb..103dec56 100644 --- a/erp24/services/MarketplaceService.php +++ b/erp24/services/MarketplaceService.php @@ -476,7 +476,7 @@ class MarketplaceService $result[] = [ 'id' => $product->id, 'name' => $properties['displayName'], - 'pictures' => $properties['imageUrls'], + 'pictures' => !empty($properties['imageUrls']) ? $properties['imageUrls'] : [$properties['imageUrl']], 'price' => $price, 'oldprice' => MarketplaceService::getProductOldPrice($product->id), 'description' => MarketplaceService::getProductDescription($product->id), @@ -666,8 +666,8 @@ class MarketplaceService ->where(['guid' => $guid]) ->all(); foreach ($data as $media) { - if (!empty($data->file)) { - $resultData = FileService::getFile($data->file); + if (!empty($media->file)) { + $resultData = FileService::getFile($media->file); if (File::src($resultData, 'images') != null) { $fileName = File::src($resultData, 'images'); $urls[] = 'https://media.erp-flowers.ru/media/view-url?url=' . $fileName;