From acb0fe2563ff10d3c4776960a0ea51d649e2e129 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Tue, 15 Apr 2025 14:37:06 +0300 Subject: [PATCH] debug --- erp24/commands/MatrixErpController.php | 3 ++- erp24/records/MatrixErp.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/erp24/commands/MatrixErpController.php b/erp24/commands/MatrixErpController.php index e6df3615..ae16dbaf 100644 --- a/erp24/commands/MatrixErpController.php +++ b/erp24/commands/MatrixErpController.php @@ -29,7 +29,7 @@ class MatrixErpController extends Controller foreach (MatrixErpPropertyDynamic::fieldByCategory() as $category => $field) { $matrixErpPropertyDynamicByGuid[$category] = MatrixErpPropertyDynamic::find() ->where(['product_id' => ArrayHelper::getColumn($products, 'id'), 'category' => $category]) - ->indexBy('product_id')->asArray()->all(); + ->indexBy('product_id')->all(); } foreach ($products as $product) { @@ -55,6 +55,7 @@ class MatrixErpController extends Controller $matrixErpPropertyDynamic2->category = $category; $matrixErpPropertyDynamic2->date_from = date("Y-m-d H:i:s"); $matrixErpPropertyDynamic2->date_end = '2100-01-01 00:00:00'; + $matrixErpPropertyDynamic2->active = 1; $matrixErpPropertyDynamic2->save(); if ($matrixErpPropertyDynamic2->getErrors()) { var_dump($matrixErpPropertyDynamic2->getErrors()); diff --git a/erp24/records/MatrixErp.php b/erp24/records/MatrixErp.php index 33094605..2d468f71 100644 --- a/erp24/records/MatrixErp.php +++ b/erp24/records/MatrixErp.php @@ -61,7 +61,8 @@ class MatrixErp extends \yii\db\ActiveRecord { return [ [['guid', 'date_from'], 'required'], - [['category_id', 'active', 'created_admin_id', 'created_at', 'updated_admin_id', 'updated_at'], 'integer'], + [['updated_at', 'created_at'], 'safe'], + [['category_id', 'active', 'created_admin_id', 'updated_admin_id'], 'integer'], [['components', 'deleted_at'], 'string'], [['id', 'deleted_by'], 'integer'], [['guid', 'parent_id', 'group_name', 'code', 'articule', 'date_from', 'date_to'], 'string', 'max' => 100], -- 2.39.5