]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Изменение прав
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 26 Aug 2025 12:38:59 +0000 (15:38 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 26 Aug 2025 12:38:59 +0000 (15:38 +0300)
erp24/api2/controllers/DataController.php

index 50034b8fec8f61a8c305855f9ae2ea21187d3002..bb60ba92617ba4b7347b78c5f708b8f0804027eb 100644 (file)
@@ -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
                                         )
                                     );