From 00a4980f9051e28836dc3dc725836f0709d8a677 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Thu, 8 Aug 2024 12:10:24 +0300 Subject: [PATCH] =?utf8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=B8=D0=B5=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/MotivationService.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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())); } } } -- 2.39.5