From db142fe515da893d0fcf6aaaef6f3598b70ff327 Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Wed, 1 Oct 2025 18:13:24 +0300 Subject: [PATCH] =?utf8?q?=D0=9F=D1=80=D0=B5=D0=B4=D1=81=D1=82=D0=B0=D0=B2?= =?utf8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/views/marketplace-prices-log/index.php | 52 +++++++++++++++++--- erp24/views/marketplace-prices/_form.php | 6 +-- erp24/views/marketplace-prices/index.php | 31 +++++++++++- 3 files changed, 75 insertions(+), 14 deletions(-) diff --git a/erp24/views/marketplace-prices-log/index.php b/erp24/views/marketplace-prices-log/index.php index 0221a0a5..08d0ad83 100644 --- a/erp24/views/marketplace-prices-log/index.php +++ b/erp24/views/marketplace-prices-log/index.php @@ -1,5 +1,6 @@ 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(); + }, + ], ], ]); ?> diff --git a/erp24/views/marketplace-prices/_form.php b/erp24/views/marketplace-prices/_form.php index 003c9f79..0f38f5bf 100644 --- a/erp24/views/marketplace-prices/_form.php +++ b/erp24/views/marketplace-prices/_form.php @@ -22,12 +22,8 @@ use yii\widgets\ActiveForm; field($model, 'old_price')->textInput() ?> - field($model, 'created_at')->textInput() ?> - - field($model, 'updated_at')->textInput() ?> -
- 'btn btn-success']) ?> + 'btn btn-success']) ?>
diff --git a/erp24/views/marketplace-prices/index.php b/erp24/views/marketplace-prices/index.php index 29c5c3cd..ee9eb871 100644 --- a/erp24/views/marketplace-prices/index.php +++ b/erp24/views/marketplace-prices/index.php @@ -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', -- 2.39.5