]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-140] Исправление недочёта
authorAlexander Smirnov <fredeom@mail.ru>
Tue, 3 Sep 2024 14:18:15 +0000 (17:18 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Tue, 3 Sep 2024 14:18:15 +0000 (17:18 +0300)
erp24/services/MotivationService.php

index ef1abf89c1a88ac390d8b36ecf59f0053a29f56f..b262da9e67b5d6f1b754399cd4b1cf513f741a55 100644 (file)
@@ -534,6 +534,9 @@ class MotivationService
             if ($weekEnd > $monthEnd) {
                 $weekEnd = $monthEnd;
             }
+            if ($weekStart > $monthEnd) {
+                continue;
+            }
 
             // Ищем продажи по продуктовым гуидам по каталог-гуидам категории service
             $sales = Sales::find()->alias('s')
@@ -632,6 +635,9 @@ class MotivationService
             if ($weekEnd > $monthEnd) {
                 $weekEnd = $monthEnd;
             }
+            if ($weekStart > $monthEnd) {
+                continue;
+            }
 
             $sales = Sales::find()
                 ->where(['between', 'date', $weekStart, $weekEnd])