$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'],
$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);
* 'monthlyPrice' => [ 'YYYY-MM' => цена ]
* ]
*/
- public static function calculateProductSalesShare($storeId, $selectedMonth, $productsWithHistory)
+ public static function calculateProductSalesShareProductsWithHistory($storeId, $selectedMonth, $productsWithHistory)
{
$targetDate = strtotime(date('Y') . "-$selectedMonth-01");