From: Alexander Smirnov Date: Fri, 28 Mar 2025 06:52:21 +0000 (+0300) Subject: новая порция X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=b21872d92d39bd80494f0603410abd475ffe8478;p=erp24_rep%2Fyii-erp24%2F.git новая порция --- 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')); }