From c445984fd71bdce5d7df61ed6edf0a96ac97e6cc Mon Sep 17 00:00:00 2001 From: fomichev Date: Tue, 27 May 2025 14:32:51 +0300 Subject: [PATCH] =?utf8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5=D0=BD?= =?utf8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BC=D0=B5=D1=82=D0=BE?= =?utf8?q?=D0=B4=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/AutoPlannogrammaController.php | 4 ++-- erp24/controllers/CategoryPlanController.php | 2 +- erp24/services/AutoPlannogrammaService.php | 2 +- erp24/services/StorePlanService.php | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/erp24/controllers/AutoPlannogrammaController.php b/erp24/controllers/AutoPlannogrammaController.php index a3360580..d0dfa07f 100644 --- a/erp24/controllers/AutoPlannogrammaController.php +++ b/erp24/controllers/AutoPlannogrammaController.php @@ -720,13 +720,13 @@ class AutoPlannogrammaController extends BaseController $result['without_history'] ); - $productSalesShare = StorePlanService::calculateProductSalesShare( + $productSalesShare = StorePlanService::calculateProductSalesShareProductsWithHistory( $filters['store_id'], $filters['month'], $result['with_history'] ); - $productSalesForecast = $service->calculateProductForecastInPieces( + $productSalesForecast = $service->calculateProductForecastInPiecesProductsWithHistory( $filters['store_id'], $filters['month'], $filters['category'], diff --git a/erp24/controllers/CategoryPlanController.php b/erp24/controllers/CategoryPlanController.php index ee292ebb..ec7a1901 100644 --- a/erp24/controllers/CategoryPlanController.php +++ b/erp24/controllers/CategoryPlanController.php @@ -355,7 +355,7 @@ class CategoryPlanController extends Controller { $result['without_history'] ); - $productSalesShare = StorePlanService::calculateProductSalesShare( + $productSalesShare = StorePlanService::calculateProductSalesShareProductsWithHistory( $storeId, $selectedMonth, $result['with_history'] diff --git a/erp24/services/AutoPlannogrammaService.php b/erp24/services/AutoPlannogrammaService.php index 065c95cd..34d3de89 100644 --- a/erp24/services/AutoPlannogrammaService.php +++ b/erp24/services/AutoPlannogrammaService.php @@ -825,7 +825,7 @@ class AutoPlannogrammaService return $result; } - public static function calculateProductForecastInPieces( + public static function calculateProductForecastInPiecesProductsWithHistory( int $storeId, string $month, string $category, diff --git a/erp24/services/StorePlanService.php b/erp24/services/StorePlanService.php index fbc18625..f24f6dac 100755 --- a/erp24/services/StorePlanService.php +++ b/erp24/services/StorePlanService.php @@ -478,6 +478,7 @@ class StorePlanService $initTime = (hrtime(true) - $t0) / 1e6; // миллисекунды Yii::warning( "Init (periods): {$initTime} ms\n"); foreach ($productsWithoutHistory as $product) { + var_dump($product);die(); $guid = $product['guid']; $t1 = hrtime(true); $similarProductIds = self::getSimilarProductIDs($guid); @@ -986,7 +987,7 @@ class StorePlanService * 'monthlyPrice' => [ 'YYYY-MM' => цена ] * ] */ - public static function calculateProductSalesShare($storeId, $selectedMonth, $productsWithHistory) + public static function calculateProductSalesShareProductsWithHistory($storeId, $selectedMonth, $productsWithHistory) { $targetDate = strtotime(date('Y') . "-$selectedMonth-01"); -- 2.39.5