From: fomichev Date: Mon, 11 Nov 2024 14:18:11 +0000 (+0300) Subject: Проверка на dev X-Git-Tag: 1.6~13^2~14 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=cfbe69f4add47507568b59d0e7f1ddc05c617669;p=erp24_rep%2Fyii-erp24%2F.git Проверка на dev --- diff --git a/erp24/media/controllers/FlowwowController.php b/erp24/media/controllers/FlowwowController.php index 7c87188b..80279647 100644 --- a/erp24/media/controllers/FlowwowController.php +++ b/erp24/media/controllers/FlowwowController.php @@ -14,12 +14,8 @@ class FlowwowController extends Controller */ public function actionFeed($id) { - $productsInfo = MarketplaceService::getAllProductsInfo($id); - $products = MarketplaceService::infoForMarketplace(1, false); - - var_dump($products); die(); $xmlFeed = MarketplaceService::createXMLFeed($productsInfo); @@ -29,4 +25,13 @@ class FlowwowController extends Controller return $xmlFeed; } + + public function actionTest(){ + + $products = MarketplaceService::infoForMarketplace(1, false); + + var_dump($products); + + + } } \ No newline at end of file diff --git a/erp24/services/MarketplaceService.php b/erp24/services/MarketplaceService.php index 9f9f9de1..0f5ca4aa 100644 --- a/erp24/services/MarketplaceService.php +++ b/erp24/services/MarketplaceService.php @@ -64,8 +64,10 @@ class MarketplaceService ]; public static function infoForMarketplace(int $marketId, bool $is_yandex) { - if (!array_key_exists($marketId, MarketplaceStore::getWarehouseId())) - return; + if (!array_key_exists($marketId, MarketplaceStore::getWarehouseId())) { + return null; + } + $marketplacesCount = count(MarketplaceStore::getWarehouseId()); @@ -124,14 +126,16 @@ class MarketplaceService $bouquetCount = PHP_INT_MAX; foreach ($stockRecords as $productGuid => $values) { - $temp = intval($values['count'] / $products->$productGuid); + $temp = intval($values['count'] / $products[$productGuid]); $bouquetCount = !empty($bouquetCount) ? min($bouquetCount, $temp) : $temp; $store = $values['marketplace_guid']; - } + if (isset($bouquetCount) && $bouquetCount > 0) { $stocks[$guid] = ['count' => $bouquetCount, 'store' => $store]; } + } + } // 5. Получение приоритетов