From: marina Date: Fri, 27 Dec 2024 09:44:41 +0000 (+0300) Subject: ERP-275 Добавление колонки для сохранения type в товаре из каталога X-Git-Tag: 1.7~103^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=87c77c4b32d1081259a957346586d430f3ad7d4f;p=erp24_rep%2Fyii-erp24%2F.git ERP-275 Добавление колонки для сохранения type в товаре из каталога --- 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', ]; }