From b21872d92d39bd80494f0603410abd475ffe8478 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Fri, 28 Mar 2025 09:52:21 +0300 Subject: [PATCH] =?utf8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D1=8F=20=D0=BF=D0=BE?= =?utf8?q?=D1=80=D1=86=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/orders/DeliveryAction.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/erp24/actions/orders/DeliveryAction.php b/erp24/actions/orders/DeliveryAction.php index 07192bc7..fc5ab8e3 100644 --- a/erp24/actions/orders/DeliveryAction.php +++ b/erp24/actions/orders/DeliveryAction.php @@ -91,7 +91,24 @@ class DeliveryAction extends Action $storesNameArr[$cityStore->adress_amo] = $cityStore->id; } + $checkarr = Sales::find()->where(['>=', 'date', date('Y-m-d H:i:s', strtotime('-30 days', time()))])->limit(1750)->asArray()->all(); + $sale = []; + $check_sale_cnt = []; + $check_vozvrat_cnt = []; + + foreach($checkarr as $checkr) { + /* @var $checkr Sales */ + if (!in_array($checkr["order_id"], $check_sale_cnt)) { + $check_sale_cnt[$checkr["order_id"]] = 0; + } + if (!in_array($checkr["order_id"], $check_vozvrat_cnt)) { + $check_vozvrat_cnt[$checkr["order_id"]] = 0; + } + if (!in_array($checkr["order_id"], $sale)) { + $sale[$checkr["order_id"]] = ''; + } + } return $this->controller->render('delivery', compact('yesses', 'lid_id', 'delivery_date', 'status_ar2')); } -- 2.39.5