From: fomichev Date: Wed, 4 Jun 2025 14:22:26 +0000 (+0300) Subject: Добавление миграции и модели X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=af0dd59a3cf02ccc0a56b71f3cb8bd445c7a7ef0;p=erp24_rep%2Fyii-erp24%2F.git Добавление миграции и модели --- diff --git a/erp24/migrations/m250604_141110_create_marketplace_order_1c_statuses_relations_table.php b/erp24/migrations/m250604_141110_create_marketplace_order_1c_statuses_relations_table.php new file mode 100644 index 00000000..8833354e --- /dev/null +++ b/erp24/migrations/m250604_141110_create_marketplace_order_1c_statuses_relations_table.php @@ -0,0 +1,43 @@ +db->getTableSchema(self::TABLE_NAME); + + if (!isset($tableSchema)) { + $this->createTable(self::TABLE_NAME, [ + 'id' => $this->primaryKey(), + + 'status_id_from' => $this->integer()->comment('Cтатус текущий - ссылка на id из таблицы marketplace_order_1c_statuses'), + 'status_id_to' => $this->integer()->comment('Cтатус для перехода - ссылка на id из таблицы marketplace_order_1c_statuses'), + 'description' => $this->text()->null()->comment('Описание для 1С'), + 'button_text' => $this->string()->null()->comment('Текст кнопки'), + 'created_at' => $this->dateTime()->comment('Дата создания'), + 'updated_at' => $this->dateTime()->comment('Дата обновления'), + + ]); + } + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + $tableSchema = $this->db->getTableSchema(self::TABLE_NAME); + if (isset($tableSchema)) { + $this->dropTable(self::TABLE_NAME); + } + } +} diff --git a/erp24/records/MarketplaceOrder1cStatusesRelations.php b/erp24/records/MarketplaceOrder1cStatusesRelations.php new file mode 100644 index 00000000..c035c6e1 --- /dev/null +++ b/erp24/records/MarketplaceOrder1cStatusesRelations.php @@ -0,0 +1,61 @@ + null], + [['status_id_from', 'status_id_to'], 'default', 'value' => null], + [['status_id_from', 'status_id_to'], 'integer'], + [['description'], 'string'], + [['created_at', 'updated_at'], 'safe'], + [['button_text'], 'string', 'max' => 255], + ]; + } + + /** + * {@inheritdoc} + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'status_id_from' => 'Status Id From', + 'status_id_to' => 'Status Id To', + 'description' => 'Description', + 'button_text' => 'Button Text', + 'created_at' => 'Created At', + 'updated_at' => 'Updated At', + ]; + } + +}