From af0dd59a3cf02ccc0a56b71f3cb8bd445c7a7ef0 Mon Sep 17 00:00:00 2001 From: fomichev Date: Wed, 4 Jun 2025 17:22:26 +0300 Subject: [PATCH] =?utf8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?utf8?q?=D0=B8=D0=B5=20=D0=BC=D0=B8=D0=B3=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= =?utf8?q?=20=D0=B8=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ...lace_order_1c_statuses_relations_table.php | 43 +++++++++++++ .../MarketplaceOrder1cStatusesRelations.php | 61 +++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 erp24/migrations/m250604_141110_create_marketplace_order_1c_statuses_relations_table.php create mode 100644 erp24/records/MarketplaceOrder1cStatusesRelations.php 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', + ]; + } + +} -- 2.39.5