From: Alexander Smirnov Date: Thu, 8 Aug 2024 09:10:24 +0000 (+0300) Subject: Исправление времени X-Git-Tag: 1.4~43^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=00a4980f9051e28836dc3dc725836f0709d8a677;p=erp24_rep%2Fyii-erp24%2F.git Исправление времени --- diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index 157a8de8..73f96610 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -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())); } } }