Commit 96c82e6447f5038a166a457a0e6b9e071e36b50c

Authored by Volodymyr
1 parent 8effd263

product admin price

backend/views/product/_form.php
@@ -28,6 +28,8 @@ @@ -28,6 +28,8 @@
28 ) ?> 28 ) ?>
29 <?= $form->field($model, 'sku') 29 <?= $form->field($model, 'sku')
30 ->textInput() ?> 30 ->textInput() ?>
  31 + <?= $form->field($model, 'price')
  32 + ->textInput() ?>
31 <?= $form->field($model, 'sort') 33 <?= $form->field($model, 'sort')
32 ->textInput() ?> 34 ->textInput() ?>
33 35
common/messages/ru/app.php
@@ -391,6 +391,7 @@ return [ @@ -391,6 +391,7 @@ return [
391 'Номінальна потужність мережевого інвертора'=>'Номінальна потужність мережевого інвертора', 391 'Номінальна потужність мережевого інвертора'=>'Номінальна потужність мережевого інвертора',
392 'Встановлена потужність фотоелектричних модулів'=>'Встановлена потужність фотоелектричних модулів', 392 'Встановлена потужність фотоелектричних модулів'=>'Встановлена потужність фотоелектричних модулів',
393 'Вартість системи "під ключ"'=>'Стоимость системы "под ключ"', 393 'Вартість системи "під ключ"'=>'Стоимость системы "под ключ"',
  394 + 'Price'=>'Цена',
394 395
395 396
396 397
common/messages/ua/app.php
@@ -390,6 +390,7 @@ return [ @@ -390,6 +390,7 @@ return [
390 'calc-text-3'=> 'Окупність', 390 'calc-text-3'=> 'Окупність',
391 'calc-text-4'=> 'років', 391 'calc-text-4'=> 'років',
392 'section-question__title'=> 'ПОШИРЕНІ ЗАПИТАННЯ', 392 'section-question__title'=> 'ПОШИРЕНІ ЗАПИТАННЯ',
  393 + 'Price'=>'Ціна',
393 394
394 395
395 ]; 396 ];
396 \ No newline at end of file 397 \ No newline at end of file
common/models/Product.php
@@ -4,6 +4,7 @@ namespace common\models; @@ -4,6 +4,7 @@ namespace common\models;
4 4
5 use artbox\core\behaviors\LanguageBehavior; 5 use artbox\core\behaviors\LanguageBehavior;
6 use artbox\core\models\Image; 6 use artbox\core\models\Image;
  7 +use Yii;
7 use yii\db\ActiveRecord; 8 use yii\db\ActiveRecord;
8 9
9 class Product extends ActiveRecord 10 class Product extends ActiveRecord
@@ -43,6 +44,7 @@ class Product extends ActiveRecord @@ -43,6 +44,7 @@ class Product extends ActiveRecord
43 [ 44 [
44 [ 45 [
45 'sku', 46 'sku',
  47 + 'price',
46 ], 48 ],
47 'string', 49 'string',
48 'max' => 255, 50 'max' => 255,
@@ -63,7 +65,20 @@ class Product extends ActiveRecord @@ -63,7 +65,20 @@ class Product extends ActiveRecord
63 ], 65 ],
64 ]; 66 ];
65 } 67 }
  68 + /**
  69 + * @inheritdoc
  70 + */
  71 + public function attributeLabels()
  72 + {
  73 + return [
  74 + 'id' => Yii::t('core', 'ID'),
  75 + 'status' => Yii::t('core', 'Status'),
  76 + 'sort' => Yii::t('core', 'Sort'),
  77 + 'price' => Yii::t('app', 'Price'),
  78 +// 'image_mini_id' => Yii::t('core', 'Image Mini'),
66 79
  80 + ];
  81 + }
67 /** 82 /**
68 * @return \yii\db\ActiveQuery 83 * @return \yii\db\ActiveQuery
69 */ 84 */
console/migrations/m220412_144550_create_product_table.php
@@ -17,6 +17,7 @@ class m220412_144550_create_product_table extends Migration @@ -17,6 +17,7 @@ class m220412_144550_create_product_table extends Migration
17 'status' => $this->boolean(), 17 'status' => $this->boolean(),
18 'sort' => $this->smallInteger(), 18 'sort' => $this->smallInteger(),
19 'sku' =>$this->string(255), 19 'sku' =>$this->string(255),
  20 + 'price' =>$this->string(255),
20 'image_id' => $this->integer(), 21 'image_id' => $this->integer(),
21 ]); 22 ]);
22 $this->addForeignKey( 23 $this->addForeignKey(