From: Alexander Smirnov Date: Fri, 14 Mar 2025 06:24:39 +0000 (+0300) Subject: [ERP-370] поправил логику 2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=eaa37171144a65fa2b70f00993ff7605aefbffbc;p=erp24_rep%2Fyii-erp24%2F.git [ERP-370] поправил логику 2 --- diff --git a/erp24/commands/PriceController.php b/erp24/commands/PriceController.php index b18a158f..8c0cc0f8 100644 --- a/erp24/commands/PriceController.php +++ b/erp24/commands/PriceController.php @@ -23,9 +23,13 @@ class PriceController extends Controller { $cnt = count($priceDynamicDatas); for ($ind = 0; $ind < $cnt - 1; $cnt++) { if ($ind < $cnt - 1) { - PricesDynamic::updateAll(['active' => 0, 'date_to' => $priceDynamicDatas[$ind+1]['date_to']], + PricesDynamic::updateAll(['active' => 0, 'region_id' => 52, 'date_to' => $priceDynamicDatas[$ind+1]['date_to']], ['id' => $priceDynamicDatas[$ind]['id']]); echo '1'; + } else { + PricesDynamic::updateAll(['active' => 0, 'region_id' => 52, 'date_to' => $p[52][$productId][count($p[52][$productId]) - 1]['date_to']], + ['id' => $priceDynamicDatas[$ind]['id']]); + echo '2'; } } }