]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Исправление времени
authorAlexander Smirnov <fredeom@mail.ru>
Thu, 8 Aug 2024 09:10:24 +0000 (12:10 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Thu, 8 Aug 2024 09:10:24 +0000 (12:10 +0300)
erp24/services/MotivationService.php

index 157a8de8a2eb853fa56f439e16fda286be97edf3..73f9661021ff664121df76d799a75c4436a8bc52 100644 (file)
@@ -345,7 +345,7 @@ class MotivationService
 
         foreach (range(1, 5) as $ind) {
             $weekStart = date("Y-m-d 00:00:00", strtotime("+" . (($ind - 1) * 7) . ' days', strtotime($monthStart)));
-            $weekEnd = date("Y-m-d 23:50:50", strtotime("+" . ($ind * 7 - 1) . ' days', strtotime($monthStart)));
+            $weekEnd = date("Y-m-d 23:59:59", strtotime("+" . ($ind * 7 - 1) . ' days', strtotime($monthStart)));
             if ($weekEnd > $monthEnd) {
                 $weekEnd = $monthEnd;
             }
@@ -471,8 +471,7 @@ class MotivationService
                 $motivationValue->save();
                 //var_dump($motivationValue); die;
                 if ($motivationValue->getErrors()) {
-                    var_dump($motivationValue->getErrors());
-                    die;
+                    throw new \Exception(Json::encode($motivationValue->getErrors()));
                 }
             }
 
@@ -513,8 +512,7 @@ class MotivationService
                 $motivationValue->value_float = $salesProduct['total'];
                 $motivationValue->save();
                 if ($motivationValue->getErrors()) {
-                    var_dump($motivationValue->getErrors());
-                    die;
+                    throw new \Exception(Json::encode($motivationValue->getErrors()));
                 }
             }
         }