]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Представления
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 1 Oct 2025 15:13:24 +0000 (18:13 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 1 Oct 2025 15:13:24 +0000 (18:13 +0300)
erp24/views/marketplace-prices-log/index.php
erp24/views/marketplace-prices/_form.php
erp24/views/marketplace-prices/index.php

index 0221a0a56205d6950706758be95aeea251b76b3d..08d0ad83922c624e5edee3a52d12f5d48439e5b4 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+use yii_app\records\Admin;
 use yii_app\records\MarketplacePricesLog;
 use yii\helpers\Html;
 use yii\helpers\Url;
@@ -26,14 +27,51 @@ $this->params['breadcrumbs'][] = $this->title;
             ['class' => 'yii\grid\SerialColumn'],
 
             'id',
-            'marketplace_prices_id',
-            'action',
-            'price_before',
-            'price_after',
-            'old_price_before',
-            'old_price_after',
+
+            [
+                'attribute' => 'marketplace_prices_id',
+                'label' => 'Товар',
+                'format' => 'raw',
+                'value' => function ($model) {
+                    $mpPrice = \yii_app\records\MarketplacePrices::find()
+                        ->where(['id' => $model->marketplace_prices_id])->one();
+
+                    return \yii_app\records\MatrixErp::find()->select('articule')
+                        ->where(['id' => $mpPrice->matrix_erp_id])->scalar();
+                },
+            ],
+            [
+                'attribute' => 'action',
+                'label' => 'Действие',
+                'value' => function ($model) {
+                    return $model->action == 1 ? 'Создание' : 'Изменение';
+                },
+            ],
+            [
+                'attribute' => 'price_before',
+                'label' => 'Цена до',
+            ],
+            [
+                'attribute' => 'price_after',
+                'label' => 'Цена после',
+            ],
+            [
+                'attribute' => 'old_price_before',
+                'label' => 'Старая Цена до',
+            ],
+            [
+                'attribute' => 'old_price_after',
+                'label' => 'Старая Цена после',
+            ],
             'changed_at',
-            'changed_by',
+            [
+                'attribute' => 'changed_by',
+                'label' => 'Кем изменено',
+                'format' => 'raw',
+                'value' => function ($model) {
+                    return Admin::find()->select('name')->where(['id' => $model->changed_by])->scalar();
+                },
+            ],
         ],
     ]); ?>
 
index 003c9f795924f478de8e111744f56e7ba360a621..0f38f5bf2a7728aa9537f337db71bcb2864548e2 100644 (file)
@@ -22,12 +22,8 @@ use yii\widgets\ActiveForm;
 
     <?= $form->field($model, 'old_price')->textInput() ?>
 
-    <?= $form->field($model, 'created_at')->textInput() ?>
-
-    <?= $form->field($model, 'updated_at')->textInput() ?>
-
     <div class="form-group">
-        <?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
+        <?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
     </div>
 
     <?php ActiveForm::end(); ?>
index 29c5c3cdb83e76567507c31187319f0d563b7589..ee9eb871eedb260536d49c72d2ce0866001cb861 100644 (file)
@@ -37,8 +37,35 @@ $this->params['breadcrumbs'][] = $this->title;
             ['class' => 'yii\grid\SerialColumn'],
 
             'id',
-            'matrix_erp_id',
-            'marketplace_id',
+            [
+                'attribute' => 'matrix_erp_id',
+                'label' => 'Артикул товара',
+                'format' => 'raw',
+                'value' => function ($model) {
+                    $matrixProduct = \yii_app\records\MatrixErp::find()
+                        ->where(['id' => $model->matrix_erp_id])->one();
+                    return Html::a($matrixProduct->articule, '/matrix-erp/update?id=' . $model->matrix_erp_id);
+
+                },
+            ],
+            [
+                'attribute' => 'matrix_erp_id',
+                'label' => 'Наименование товара',
+                'format' => 'raw',
+                'value' => function ($model) {
+                    $matrixProduct = \yii_app\records\MatrixErp::find()
+                        ->where(['id' => $model->matrix_erp_id])->one();
+                    return Html::a($matrixProduct->name, '/matrix-erp/update?id=' . $model->matrix_erp_id);
+
+                },
+            ],
+            [
+                'attribute' => 'marketplace_id',
+                'label' => 'Маркетплейс',
+                'value' => function ($model) {
+                    return $model->marketplace_id == 1 ? 'ЯндексМаркет' : 'Flowwow';
+                },
+            ],
             'marketplace_alias',
             'price',
             'old_price',