if (!$products1c6) {
$products1c6 = new Products1c;
$products1c6->id = $arr["id"];
+ $products1c6->type = $arr["type"];
$products1c6->tip = 'products';
}
$products1c6->name = $arr["name"];
--- /dev/null
+<?php
+
+use yii\db\Migration;
+
+class m241227_093337_add_type_column_on_products_1c extends Migration
+{
+
+ const TABLE_NAME = 'erp24.products_1c';
+
+ public function safeUp()
+ {
+ $this->addColumn(
+ self::TABLE_NAME,
+ 'type',
+ $this->string(255)
+ ->null()
+ ->comment('Тип товара в системе 1С')
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function safeDown()
+ {
+ $this->dropColumn(self::TABLE_NAME, 'type');
+
+ }
+}
[['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'],
];
'name' => 'Name',
'articule' => 'Articule',
'view' => 'View',
+ 'type' => 'Type',
'components' => 'Components',
];
}