From 87c77c4b32d1081259a957346586d430f3ad7d4f Mon Sep 17 00:00:00 2001 From: marina Date: Fri, 27 Dec 2024 12:44:41 +0300 Subject: [PATCH] =?utf8?q?ERP-275=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?utf8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BB=D0=BE=D0=BD=D0=BA?= =?utf8?q?=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=BE=D1=85=D1=80=D0=B0?= =?utf8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20type=20=D0=B2=20=D1=82=D0=BE?= =?utf8?q?=D0=B2=D0=B0=D1=80=D0=B5=20=D0=B8=D0=B7=20=D0=BA=D0=B0=D1=82?= =?utf8?q?=D0=B0=D0=BB=D0=BE=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/api2/controllers/DataController.php | 1 + ..._093337_add_type_column_on_products_1c.php | 29 +++++++++++++++++++ erp24/records/Products1c.php | 3 +- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 erp24/migrations/m241227_093337_add_type_column_on_products_1c.php diff --git a/erp24/api2/controllers/DataController.php b/erp24/api2/controllers/DataController.php index 92fbd850..f9425c9c 100644 --- a/erp24/api2/controllers/DataController.php +++ b/erp24/api2/controllers/DataController.php @@ -868,6 +868,7 @@ class DataController extends BaseController if (!$products1c6) { $products1c6 = new Products1c; $products1c6->id = $arr["id"]; + $products1c6->type = $arr["type"]; $products1c6->tip = 'products'; } $products1c6->name = $arr["name"]; diff --git a/erp24/migrations/m241227_093337_add_type_column_on_products_1c.php b/erp24/migrations/m241227_093337_add_type_column_on_products_1c.php new file mode 100644 index 00000000..9483296c --- /dev/null +++ b/erp24/migrations/m241227_093337_add_type_column_on_products_1c.php @@ -0,0 +1,29 @@ +addColumn( + self::TABLE_NAME, + 'type', + $this->string(255) + ->null() + ->comment('Тип товара в системе 1С') + ); + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + $this->dropColumn(self::TABLE_NAME, 'type'); + + } +} diff --git a/erp24/records/Products1c.php b/erp24/records/Products1c.php index 5662bd7c..4a723841 100644 --- a/erp24/records/Products1c.php +++ b/erp24/records/Products1c.php @@ -39,7 +39,7 @@ class Products1c extends \yii\db\ActiveRecord [['view'], 'integer'], [['id', 'parent_id', 'code', 'articule'], 'string', 'max' => 36], [['tip'], 'string', 'max' => 25], - [['name'], 'string', 'max' => 255], + [['name', 'type'], 'string', 'max' => 255], [['id'], 'unique'], [['components'], 'string'], ]; @@ -58,6 +58,7 @@ class Products1c extends \yii\db\ActiveRecord 'name' => 'Name', 'articule' => 'Articule', 'view' => 'View', + 'type' => 'Type', 'components' => 'Components', ]; } -- 2.39.5