From: Vladimir Fomichev Date: Thu, 2 Oct 2025 10:39:48 +0000 (+0300) Subject: Правки по контроллеру X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=68b94dcf9d77d73718d0c35b42081ff64eac4c70;p=erp24_rep%2Fyii-erp24%2F.git Правки по контроллеру --- diff --git a/erp24/controllers/MarketplaceController.php b/erp24/controllers/MarketplaceController.php index ec28a5c5..5c64531e 100644 --- a/erp24/controllers/MarketplaceController.php +++ b/erp24/controllers/MarketplaceController.php @@ -23,7 +23,7 @@ class MarketplaceController extends Controller public function actionFeed() { // Получаем информацию о продуктах - $productsInfo = MarketplaceService::getAllProductsInfo(10); // Получаем 10 товаров по умолчанию + $productsInfo = MarketplaceService::getAllProductsInfo(10); // Генерируем XML-фид $xmlFeed = MarketplaceService::createXMLFeed($productsInfo); diff --git a/erp24/services/MarketplaceService.php b/erp24/services/MarketplaceService.php index 4c3a73c0..fbca7240 100644 --- a/erp24/services/MarketplaceService.php +++ b/erp24/services/MarketplaceService.php @@ -309,7 +309,7 @@ class MarketplaceService * * @return array */ - public static function getAllProductsInfo($id, $marketplaceId = 2) // 2 = Flowwow по умолчанию + public static function getAllProductsInfo(int $items, $marketplaceId = 2) // 2 = Flowwow по умолчанию { $parents = ProductsClass::find() ->select('category_id') @@ -323,7 +323,7 @@ class MarketplaceService ->andWhere(['parent_id' => $parents]) ->all(); - $count = (int)$id; + $count = (int)$items; $selectedProducts = array_slice($products, 0, $count); $result = [];