From: Aleksey Filippov Date: Mon, 26 Aug 2024 12:00:10 +0000 (+0300) Subject: Таблица для хранения себестоимости X-Git-Tag: 1.4~26^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=daf7eee9fe7301f702766d5dcd541b4b653553a1;p=erp24_rep%2Fyii-erp24%2F.git Таблица для хранения себестоимости --- 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', + ]; + } +}