diff --git a/backend/views/product/_form.php b/backend/views/product/_form.php index 56851c7..67390ab 100755 --- a/backend/views/product/_form.php +++ b/backend/views/product/_form.php @@ -28,6 +28,8 @@ ) ?> field($model, 'sku') ->textInput() ?> + field($model, 'price') + ->textInput() ?> field($model, 'sort') ->textInput() ?> diff --git a/common/messages/ru/app.php b/common/messages/ru/app.php index 23eff86..1e5a12e 100755 --- a/common/messages/ru/app.php +++ b/common/messages/ru/app.php @@ -391,6 +391,7 @@ return [ 'Номінальна потужність мережевого інвертора'=>'Номінальна потужність мережевого інвертора', 'Встановлена потужність фотоелектричних модулів'=>'Встановлена потужність фотоелектричних модулів', 'Вартість системи "під ключ"'=>'Стоимость системы "под ключ"', + 'Price'=>'Цена', diff --git a/common/messages/ua/app.php b/common/messages/ua/app.php index 40a2cb1..5319ce9 100755 --- a/common/messages/ua/app.php +++ b/common/messages/ua/app.php @@ -390,6 +390,7 @@ return [ 'calc-text-3'=> 'Окупність', 'calc-text-4'=> 'років', 'section-question__title'=> 'ПОШИРЕНІ ЗАПИТАННЯ', + 'Price'=>'Ціна', ]; \ No newline at end of file diff --git a/common/models/Product.php b/common/models/Product.php index 3508a3e..83177e1 100644 --- a/common/models/Product.php +++ b/common/models/Product.php @@ -4,6 +4,7 @@ namespace common\models; use artbox\core\behaviors\LanguageBehavior; use artbox\core\models\Image; +use Yii; use yii\db\ActiveRecord; class Product extends ActiveRecord @@ -43,6 +44,7 @@ class Product extends ActiveRecord [ [ 'sku', + 'price', ], 'string', 'max' => 255, @@ -63,7 +65,20 @@ class Product extends ActiveRecord ], ]; } + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'id' => Yii::t('core', 'ID'), + 'status' => Yii::t('core', 'Status'), + 'sort' => Yii::t('core', 'Sort'), + 'price' => Yii::t('app', 'Price'), +// 'image_mini_id' => Yii::t('core', 'Image Mini'), + ]; + } /** * @return \yii\db\ActiveQuery */ diff --git a/console/migrations/m220412_144550_create_product_table.php b/console/migrations/m220412_144550_create_product_table.php index 565da45..3e258a1 100644 --- a/console/migrations/m220412_144550_create_product_table.php +++ b/console/migrations/m220412_144550_create_product_table.php @@ -17,6 +17,7 @@ class m220412_144550_create_product_table extends Migration 'status' => $this->boolean(), 'sort' => $this->smallInteger(), 'sku' =>$this->string(255), + 'price' =>$this->string(255), 'image_id' => $this->integer(), ]); $this->addForeignKey( -- libgit2 0.21.4