]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Форматирование кода
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 29 Nov 2024 12:40:16 +0000 (15:40 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 29 Nov 2024 12:40:16 +0000 (15:40 +0300)
erp24/api2/controllers/DataController.php
erp24/records/Products1cAdditionalCharacteristics.php

index d8b43180316f3039878e529b5d8f2c96111640ae..4b9b1dec74b7d634fd7314c07a9a69b8d5ec654f 100644 (file)
@@ -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
+                                    )
+                                );
                             }
 
                         }
index 335559014476a3a1c5de146b84bd8d4cc6c29d85..2739bdfb2b33ef9fd14120e31b9cf319405e33ad 100644 (file)
@@ -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']],
         ];
     }