diff --git a/backend/views/product/_form.php b/backend/views/product/_form.php index 67390ab..d998e84 100755 --- a/backend/views/product/_form.php +++ b/backend/views/product/_form.php @@ -50,7 +50,12 @@ field($model, 'status') ->checkbox() ?> - + + field($model, 'type') + ->dropDownList( + ['Отображать во всех', 'Для компаний', 'Для частных лиц'] + + ) ?>
isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), diff --git a/common/models/Product.php b/common/models/Product.php index 83177e1..49d7dc6 100644 --- a/common/models/Product.php +++ b/common/models/Product.php @@ -9,6 +9,10 @@ use yii\db\ActiveRecord; class Product extends ActiveRecord { + const TYPE_BOTH = 0; + const TYPE_COMPANY = 1; + const TYPE_PRIVATE = 2; + /** * @inheritdoc */ @@ -53,6 +57,7 @@ class Product extends ActiveRecord [ 'sort', 'image_id', + 'type', ], 'integer', ], @@ -75,6 +80,7 @@ class Product extends ActiveRecord 'status' => Yii::t('core', 'Status'), 'sort' => Yii::t('core', 'Sort'), 'price' => Yii::t('app', 'Price'), + 'type' => 'Тип продукта для главной', // 'image_mini_id' => Yii::t('core', 'Image Mini'), ]; diff --git a/console/migrations/m220412_144550_create_product_table.php b/console/migrations/m220412_144550_create_product_table.php index 3e258a1..93a89a0 100644 --- a/console/migrations/m220412_144550_create_product_table.php +++ b/console/migrations/m220412_144550_create_product_table.php @@ -19,6 +19,7 @@ class m220412_144550_create_product_table extends Migration 'sku' =>$this->string(255), 'price' =>$this->string(255), 'image_id' => $this->integer(), + 'type' => $this->smallInteger(), ]); $this->addForeignKey( 'fk-product-image_id', diff --git a/frontend/views/site/index.php b/frontend/views/site/index.php index 41b0051..93df53c 100755 --- a/frontend/views/site/index.php +++ b/frontend/views/site/index.php @@ -563,4 +563,55 @@
-
\ No newline at end of file + + + + -- libgit2 0.21.4