From daf7eee9fe7301f702766d5dcd541b4b653553a1 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Mon, 26 Aug 2024 15:00:10 +0300 Subject: [PATCH] =?utf8?q?=D0=A2=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D0=B0=20?= =?utf8?q?=D0=B4=D0=BB=D1=8F=20=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8?= =?utf8?q?=D1=8F=20=D1=81=D0=B5=D0=B1=D0=B5=D1=81=D1=82=D0=BE=D0=B8=D0=BC?= =?utf8?q?=D0=BE=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../m240826_113149_create_table_self_cost.php | 34 ++++++++++++ erp24/records/SelfCostProduct.php | 55 +++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100755 erp24/migrations/m240826_113149_create_table_self_cost.php create mode 100644 erp24/records/SelfCostProduct.php diff --git a/erp24/migrations/m240826_113149_create_table_self_cost.php b/erp24/migrations/m240826_113149_create_table_self_cost.php new file mode 100755 index 00000000..20a6d6b3 --- /dev/null +++ b/erp24/migrations/m240826_113149_create_table_self_cost.php @@ -0,0 +1,34 @@ +createTable(self::TABLE_NAME, [ + 'id' => $this->primaryKey(), + 'date' => $this->date()->notNull()->comment('Дата'), + 'store_id' => $this->integer()->notNull()->comment('store id'), + 'product_guid' => $this->string()->notNull()->comment('product guid'), + 'price' => $this->float()->notNull()->comment('price'), + 'updated_at' => $this->datetime()->null()->comment('Дата внесения записи'), + ]); + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + $this->dropTable(self::TABLE_NAME); + } +} diff --git a/erp24/records/SelfCostProduct.php b/erp24/records/SelfCostProduct.php new file mode 100644 index 00000000..db86f5df --- /dev/null +++ b/erp24/records/SelfCostProduct.php @@ -0,0 +1,55 @@ + null], + [['store_id'], 'integer'], + [['price'], 'number'], + [['product_guid'], 'string', 'max' => 255], + ]; + } + + /** + * {@inheritdoc} + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'date' => 'Date', + 'store_id' => 'Store ID', + 'product_guid' => 'Product Guid', + 'price' => 'Price', + 'updated_at' => 'Updated At', + ]; + } +} -- 2.39.5