From f4155d1c81a62704a6a7a7afe4a8c14441798202 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Wed, 13 Nov 2024 12:13:52 +0300 Subject: [PATCH] =?utf8?q?[ERP-148]=20=D0=BA=D1=80=D0=B0=D1=81=D0=B8=D0=B2?= =?utf8?q?=D0=B0=D1=8F=20=D1=83=D1=80=D0=BB=20=D0=B4=D0=BB=D1=8F=20=D0=BA?= =?utf8?q?=D0=B0=D1=80=D1=82=D0=B8=D0=BD=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/api2/controllers/YandexMarketController.php | 5 +++-- erp24/media/config/media.config.php | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/erp24/api2/controllers/YandexMarketController.php b/erp24/api2/controllers/YandexMarketController.php index 52eeb6b4..6500e703 100644 --- a/erp24/api2/controllers/YandexMarketController.php +++ b/erp24/api2/controllers/YandexMarketController.php @@ -101,7 +101,8 @@ class YandexMarketController extends Controller 'offerId' => $product->id, 'category' => 'Цветы', 'marketCategoryId' => '91284', - 'name' => $matrixErpByGuid[$product->id]->matrixProperty->display_name ?? $product->name, + 'name' => !empty($matrixErpByGuid[$product->id]->matrixProperty->display_name) ? + $matrixErpByGuid[$product->id]->matrixProperty->display_name : $product->name, 'basicPrice' => [ 'currencyId' => Model\CurrencyType::RUR, 'value' => $matrixErpByGuid[$product->id]->price->price, @@ -114,7 +115,7 @@ class YandexMarketController extends Controller 'width' => $matrixErpByGuid[$product->id]->matrixProperty->width ?? 20, ]), 'description' => $matrixErpByGuid[$product->id]->matrixProperty->description ?? '-', - 'pictures' => ['https://media.erp-flowers.ru/media/view-image?id=' . ($matrixErpByGuid[$product->id]->matrixProperty->image_id ?? null)], + 'pictures' => ['https://media.erp-flowers.ru/media/view-image/' . ($matrixErpByGuid[$product->id]->matrixProperty->image_id ?? null)], ], ]); } diff --git a/erp24/media/config/media.config.php b/erp24/media/config/media.config.php index 439d3e5f..a0df36c0 100644 --- a/erp24/media/config/media.config.php +++ b/erp24/media/config/media.config.php @@ -24,7 +24,9 @@ return [ 'enablePrettyUrl' => true, 'enableStrictParsing' => false, 'showScriptName' => false, - 'rules' => [], + 'rules' => [ + 'GET media/view-image/' => 'media/view-image' + ], ], 'request' => [ 'scriptUrl' => '/', -- 2.39.5