From cc7d9e1cd860ae5989aac4de2d598a537f0c3334 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Wed, 21 Aug 2024 11:39:50 +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=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20?= =?utf8?q?=D0=B8=D0=B7=201=D1=81=20=D0=91=D1=83=D1=85=D0=B3=D0=B0=D0=BB?= =?utf8?q?=D1=82=D0=B5=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ...820_150742_create_table_motivation_buh.php | 48 ++++++++++++++ erp24/records/MotivationBuh.php | 53 ++++++++++++++++ erp24/records/MotivationBuhValue.php | 62 +++++++++++++++++++ 3 files changed, 163 insertions(+) create mode 100755 erp24/migrations/m240820_150742_create_table_motivation_buh.php create mode 100644 erp24/records/MotivationBuh.php create mode 100644 erp24/records/MotivationBuhValue.php diff --git a/erp24/migrations/m240820_150742_create_table_motivation_buh.php b/erp24/migrations/m240820_150742_create_table_motivation_buh.php new file mode 100755 index 00000000..acde2699 --- /dev/null +++ b/erp24/migrations/m240820_150742_create_table_motivation_buh.php @@ -0,0 +1,48 @@ +createTable(self::TABLE_NAME, [ + 'id' => $this->primaryKey(), + 'inn' => $this->integer()->notNull()->comment('ИНН фирмы источника данных'), + 'year' => $this->integer()->notNull()->comment('Год'), + 'month' => $this->integer()->notNull()->comment('Месяц'), + 'updated_at' => $this->datetime()->notNull()->comment('Дата изменения записи'), + 'created_at' => $this->datetime()->notNull()->comment('Дата создания записи'), + ]); + + $this->createTable(self::TABLE_NAME2, [ + 'id' => $this->primaryKey(), + 'motivation_buh_id' => $this->integer()->notNull()->comment('id motivation buh'), + 'store_id' => $this->integer()->notNull()->comment('ID магазина'), + 'motivation_group_id' => $this->integer()->notNull()->comment('group id motivation'), + 'value_id' => $this->integer()->notNull()->comment('value id'), + 'value_type' => $this->string(10)->notNull()->comment('тип значения'), + 'value_int' => $this->integer()->null()->comment('value int'), + 'value_float' => $this->float()->null()->comment('value float'), + 'value_string' => $this->string()->null()->comment('value string'), + ]); + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + $this->dropTable(self::TABLE_NAME2); + $this->dropTable(self::TABLE_NAME); + } +} diff --git a/erp24/records/MotivationBuh.php b/erp24/records/MotivationBuh.php new file mode 100644 index 00000000..d13ba336 --- /dev/null +++ b/erp24/records/MotivationBuh.php @@ -0,0 +1,53 @@ + null], + [['inn', 'year', 'month'], 'integer'], + [['updated_at', 'created_at'], 'safe'], + ]; + } + + /** + * {@inheritdoc} + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'inn' => 'Inn', + 'year' => 'Year', + 'month' => 'Month', + 'updated_at' => 'Updated At', + 'created_at' => 'Created At', + ]; + } +} \ No newline at end of file diff --git a/erp24/records/MotivationBuhValue.php b/erp24/records/MotivationBuhValue.php new file mode 100644 index 00000000..eb4978a4 --- /dev/null +++ b/erp24/records/MotivationBuhValue.php @@ -0,0 +1,62 @@ + null], + [['motivation_buh_id', 'store_id', 'motivation_group_id', 'value_id', 'value_int'], 'integer'], + [['value_float'], 'number'], + [['value_type'], 'string', 'max' => 10], + [['value_string'], 'string', 'max' => 255], + ]; + } + + /** + * {@inheritdoc} + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'motivation_buh_id' => 'Motivation Buh ID', + 'store_id' => 'Store ID', + 'motivation_group_id' => 'Motivation Group ID', + 'value_id' => 'Value ID', + 'value_type' => 'Value Type', + 'value_int' => 'Value Int', + 'value_float' => 'Value Float', + 'value_string' => 'Value String', + ]; + } +} \ No newline at end of file -- 2.39.5