From d8dcefa1ff2c04ebb066ba0ede625b28c77db326 Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Tue, 26 Aug 2025 15:38:59 +0300 Subject: [PATCH] =?utf8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8?= =?utf8?q?=D0=B5=20=D0=BF=D1=80=D0=B0=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/api2/controllers/DataController.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/erp24/api2/controllers/DataController.php b/erp24/api2/controllers/DataController.php index 50034b8f..bb60ba92 100644 --- a/erp24/api2/controllers/DataController.php +++ b/erp24/api2/controllers/DataController.php @@ -2600,31 +2600,31 @@ class DataController extends BaseController } else { if ($existingOperations[$operation['guid']]['type'] !== (int)$operation['type']) { - $operation = AnalystsBusinessOperations::findOne($operation['guid']); + $oldOperation = AnalystsBusinessOperations::findOne($operation['guid']); if (!in_array((int)$operation['type'], array_column($existingTypes, 'code'))) { $newType = new AnalystsBusinessOperationsTypes(); $newType->code = (int)$operation['type']; $newType->name = null; $newType->created_at = date('Y-m-d H:i:s'); if ($newType->save()) { - $operation->type = (int)$operation['type']; - $operation->type_id = $newType->id; + $oldOperation->type = (int)$operation['type']; + $oldOperation->type_id = $newType->id; } else { Yii::error('Ошибка сохранение типа ' . json_encode($newType->getErrors(), JSON_UNESCAPED_UNICODE), __METHOD__ ); LogService::apiErrorLog( json_encode( - ["error_id" => 44.3, "error" => $operation->getErrors()], + ["error_id" => 44.3, "error" => $oldOperation->getErrors()], JSON_UNESCAPED_UNICODE ) ); } } else { - $operation->type = (int)$operation['type']; - $operation->type_id = AnalystsBusinessOperationsTypes::find()->where(['code' => (int)$operation['type']])->one()->id; - if (!$operation->save()) { + $oldOperation->type = (int)$operation['type']; + $oldOperation->type_id = AnalystsBusinessOperationsTypes::find()->where(['code' => (int)$operation['type']])->one()->id; + if (!$oldOperation->save()) { LogService::apiErrorLog( json_encode( - ["error_id" => 44.4, "error" => $operation->getErrors()], + ["error_id" => 44.4, "error" => $oldOperation->getErrors()], JSON_UNESCAPED_UNICODE ) ); -- 2.39.5