]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
новая порция
authorAlexander Smirnov <fredeom@mail.ru>
Fri, 28 Mar 2025 06:52:21 +0000 (09:52 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Fri, 28 Mar 2025 06:52:21 +0000 (09:52 +0300)
erp24/actions/orders/DeliveryAction.php

index 07192bc76b56ceaa663bc518c99f1fc573235fa4..fc5ab8e3272ce9cf03d9f274634bdba727ac592f 100644 (file)
@@ -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'));
     }