]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-282 Нужно сделать интерфейс настройки магазина
authormarina <m.zozirova@gmail.com>
Thu, 30 Jan 2025 11:43:23 +0000 (14:43 +0300)
committermarina <m.zozirova@gmail.com>
Thu, 30 Jan 2025 11:43:23 +0000 (14:43 +0300)
erp24/services/SalesService.php

index da932537ec1064478d99a10bf30d66d50623a409..33b037f2f83b1cfde8ab6638d7ba3a58017b4e43 100755 (executable)
@@ -1125,7 +1125,7 @@ class SalesService
         $connection = Yii::$app->getDb();
 
         if ($dateFrom > '2022-12-07') {
-            if ($dateFrom > '2025-01-01') {
+            if ($dateFrom >= '2025-01-01') {
                 $command = $connection->createCommand("
                 SELECT
                     DISTINCT (sales.id),
@@ -1502,8 +1502,9 @@ class SalesService
                     ':date_to' => DateHelper::getDateTimeEndDay($dateTo, $dateTimeEndDay, $adminId),
                 ]
             );
-        } else if ($dateFrom > '2025-01-01') {
-            $command = $connection->createCommand("
+
+            if ($dateFrom >= '2025-01-01') {
+                $command = $connection->createCommand("
                 SELECT
                     DISTINCT (sales.id),
                     p.seller_id,
@@ -1544,10 +1545,11 @@ class SalesService
                 ORDER BY
                     sales.date ASC 
             ", [
-                    ':date_from' => DateHelper::getDateTimeStartDay($dateFrom, $dateTimeStartDay, $adminId),
-                    ':date_to' => DateHelper::getDateTimeEndDay($dateTo, $dateTimeEndDay, $adminId),
-                ]
-            );
+                        ':date_from' => DateHelper::getDateTimeStartDay($dateFrom, $dateTimeStartDay, $adminId),
+                        ':date_to' => DateHelper::getDateTimeEndDay($dateTo, $dateTimeEndDay, $adminId),
+                    ]
+                );
+            }
         } else {
             $command = $connection->createCommand("
                 SELECT