From: Alexander Smirnov Date: Wed, 14 Aug 2024 14:20:49 +0000 (+0300) Subject: Добавлена проверка на тип string X-Git-Tag: 1.4~36^2~1 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=4c8dd1ade341c7abf990f9cd2d4cf95fa6012567;p=erp24_rep%2Fyii-erp24%2F.git Добавлена проверка на тип string --- diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index eba9efdd..67f58551 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -549,7 +549,8 @@ class MotivationService if ($mv) { switch ($mv->value_type) { case MotivationCostsItem::DATA_TYPE_INT: { $sum += $mv->value_int; break; } - default: { $sum += $mv->value_float; $sum_type = MotivationCostsItem::DATA_TYPE_FLOAT; break; } + case MotivationCostsItem::DATA_TYPE_FLOAT: { $sum += $mv->value_float; $sum_type = MotivationCostsItem::DATA_TYPE_FLOAT; break; } + case MotivationCostsItem::DATA_TYPE_STRING: { throw new \Exception(Json::encode("Тип string невозможен для вычисления прогноза")); } }; } }