From: fomichev Date: Fri, 29 Nov 2024 12:40:16 +0000 (+0300) Subject: Форматирование кода X-Git-Tag: 1.7~212^2~4 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=bae288dfadda7cb945245bcf1ddfe4c7c4abb730;p=erp24_rep%2Fyii-erp24%2F.git Форматирование кода --- diff --git a/erp24/api2/controllers/DataController.php b/erp24/api2/controllers/DataController.php index d8b43180..4b9b1dec 100644 --- a/erp24/api2/controllers/DataController.php +++ b/erp24/api2/controllers/DataController.php @@ -621,9 +621,12 @@ class DataController extends BaseController { $additionalCharacteristic->value = $characteristic["value_name"]; if (!$additionalCharacteristic->save()) { - LogService::apiErrorLog(json_encode(["error_id" => 8.2, - "error" => $additionalCharacteristic->getErrors()], - JSON_UNESCAPED_UNICODE)); + LogService::apiErrorLog( + json_encode( + ["error_id" => 8.2, "error" => $additionalCharacteristic->getErrors()], + JSON_UNESCAPED_UNICODE + ) + ); } } } @@ -638,7 +641,11 @@ class DataController extends BaseController { $paymentTypes->name = $arr['name']; $paymentTypes->save(); if ($paymentTypes->getErrors()) { - LogService::apiErrorLog(json_encode(["error_id" => 9, "error" => $paymentTypes->getErrors()], JSON_UNESCAPED_UNICODE)); + LogService::apiErrorLog(json_encode( + ["error_id" => 9, + "error" => $paymentTypes->getErrors()], + JSON_UNESCAPED_UNICODE + )); } $products1c7 = Products1c::findOne(['id' => $arr["id"]]) ?? new Products1c(); @@ -648,7 +655,10 @@ class DataController extends BaseController { $products1c7->code = $arr["code"]; $products1c7->save(); if ($products1c7->getErrors()) { - LogService::apiErrorLog(json_encode(["error_id" => 10, "error" => $products1c7->getErrors()], JSON_UNESCAPED_UNICODE)); + LogService::apiErrorLog(json_encode( + ["error_id" => 10, "error" => $products1c7->getErrors()], + JSON_UNESCAPED_UNICODE + )); } } } @@ -656,7 +666,13 @@ class DataController extends BaseController { if (!empty($result['created_write_offs'])) { $productsNames = Products1c::getNamesByTip('products'); - file_put_contents(self::OUT_DIR . '/created_write_offs_upload_' . date("Y_m_d") . '.json', PHP_EOL . json_encode($result["created_write_offs"],JSON_UNESCAPED_UNICODE), FILE_APPEND); + file_put_contents( + self::OUT_DIR . '/created_write_offs_upload_' + . date("Y_m_d") . '.json', + PHP_EOL + . json_encode($result["created_write_offs"],JSON_UNESCAPED_UNICODE), + FILE_APPEND + ); foreach ($result["created_write_offs"] as $arr) { if (!empty($arr["id"])) { $writeOffsErp = WriteOffsErp::find()->where(['guid' => $arr["id"]])->one(); @@ -721,7 +737,12 @@ class DataController extends BaseController { $writeOffsErp->error_text = $errorText; $writeOffsErp->save(); if ($writeOffsErp->getErrors()) { - LogService::apiErrorLog(json_encode(["error_id" => 11, "error" => $writeOffsErp->getErrors()], JSON_UNESCAPED_UNICODE)); + LogService::apiErrorLog( + json_encode( + ["error_id" => 11, "error" => $writeOffsErp->getErrors()], + JSON_UNESCAPED_UNICODE + ) + ); } } else { /** @var WriteOffsErp $writeOffsErp */ @@ -729,7 +750,13 @@ class DataController extends BaseController { $writeOffsErp->number_1c = $arr["number"] ?? ''; $writeOffsErp->save(); if ($writeOffsErp->getErrors()) { - LogService::apiErrorLog(json_encode(["error_id" => 11, "error" => $writeOffsErp->getErrors()], JSON_UNESCAPED_UNICODE)); + LogService::apiErrorLog( + json_encode( + ["error_id" => 11, + "error" => $writeOffsErp->getErrors()], + JSON_UNESCAPED_UNICODE + ) + ); } } diff --git a/erp24/records/Products1cAdditionalCharacteristics.php b/erp24/records/Products1cAdditionalCharacteristics.php index 33555901..2739bdfb 100644 --- a/erp24/records/Products1cAdditionalCharacteristics.php +++ b/erp24/records/Products1cAdditionalCharacteristics.php @@ -39,7 +39,8 @@ class Products1cAdditionalCharacteristics extends \yii\db\ActiveRecord return [ [['product_id', 'property_id', 'value'], 'required'], [['product_id', 'property_id', 'value'], 'string', 'max' => 255], - [['property_id'], 'exist', 'skipOnError' => true, 'targetClass' => Products1cPropType::class, 'targetAttribute' => ['property_id' => 'id']], + [['property_id'], 'exist', 'skipOnError' => true, 'targetClass' => Products1cPropType::class, + 'targetAttribute' => ['property_id' => 'id']], ]; }