From: Vladimir Fomichev Date: Tue, 26 Aug 2025 12:38:59 +0000 (+0300) Subject: Изменение прав X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=d8dcefa1ff2c04ebb066ba0ede625b28c77db326;p=erp24_rep%2Fyii-erp24%2F.git Изменение прав --- 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 ) );