From: Alexander Smirnov Date: Wed, 13 Nov 2024 09:13:52 +0000 (+0300) Subject: [ERP-148] красивая урл для картинки X-Git-Tag: 1.6~12^2~1 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=f4155d1c81a62704a6a7a7afe4a8c14441798202;p=erp24_rep%2Fyii-erp24%2F.git [ERP-148] красивая урл для картинки --- 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' => '/',