From 2eb6367c27471d9a0dd7da92aa003b9c11547115 Mon Sep 17 00:00:00 2001 From: marina Date: Thu, 3 Jul 2025 10:56:03 +0300 Subject: [PATCH] =?utf8?q?ERP-433=20=D0=9E=D1=82=D1=87=D0=B5=D1=82=20?= =?utf8?q?=D0=BF=D0=BE=20=D0=BE=D1=81=D1=82=D0=B0=D1=82=D0=BA=D0=B0=D0=BC?= =?utf8?q?=20=D0=B1=D1=83=D0=BA=D0=B5=D1=82=D0=BE=D0=B2=20=D0=B4=D0=BB?= =?utf8?q?=D1=8F=20=D0=9C=D0=9F=20=D0=B8=20=D0=BF=D1=80=D0=B8=D1=87=D0=B8?= =?utf8?q?=D0=BD=D0=B0=D0=BC,=20=D0=B5=D1=81=D0=BB=D0=B8=20=D0=BB=D0=BE?= =?utf8?q?=D0=B3=D0=B8=D0=BA=D0=B0=20=D0=BD=D0=B5=20=D0=BF=D1=80=D0=BE?= =?utf8?q?=D1=85=D0=BE=D0=B4=D0=B8=D1=82.=20=D0=92=D0=BE=D0=B7=D0=BC=D0=BE?= =?utf8?q?=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D1=80=D1=83=D1=87=D0=BD?= =?utf8?q?=D0=BE=D0=B9=20=D0=B2=D1=8B=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8?= =?utf8?q?=20=D0=B8=D0=B7=20ERP=20=D0=B2=20Excel?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/marketplace/ReportAction.php | 28 +++++++++++----------- erp24/views/marketplace/report.php | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/erp24/actions/marketplace/ReportAction.php b/erp24/actions/marketplace/ReportAction.php index 12214b56..404173f3 100644 --- a/erp24/actions/marketplace/ReportAction.php +++ b/erp24/actions/marketplace/ReportAction.php @@ -16,9 +16,9 @@ class ReportAction extends Action { public function run() { - $storeId = Yii::$app->request->post('store', 'dbd70103-2c7b-11e9-9b87-c85b76f0e893'); - $isValid = Yii::$app->request->post('is_valid'); - $productId = Yii::$app->request->post('product_id'); + $storeId = Yii::$app->request->get('store', Yii::$app->request->post('store', 'dbd70103-2c7b-11e9-9b87-c85b76f0e893')); + $isValid = Yii::$app->request->get('is_valid', Yii::$app->request->post('is_valid')); + $productId = Yii::$app->request->get('product_id', Yii::$app->request->post('product_id')); $subQuery = Products1c::find() ->alias('p1n') @@ -62,7 +62,8 @@ class ReportAction extends Action 'p1n.name', 'p1n.articule', new \yii\db\Expression(" - ( + CASE + WHEN mep.id IS NULL OR p.price IS NULL OR mp_check.has_insufficient_quantity THEN 'Коэффициент: ' || COALESCE(mp.reminder_koef::text, '-') || E'\n' || concat_ws( E'\n', @@ -70,14 +71,16 @@ class ReportAction extends Action CASE WHEN p.price IS NULL THEN 'Нет имеет цены' ELSE NULL END, CASE WHEN mp_check.has_insufficient_quantity THEN mp_check.insuff_reason ELSE NULL END ) - ) AS reason - "), + ELSE + '' + END AS reason + "), new \yii\db\Expression(" - CASE - WHEN mep.id IS NULL OR p.price IS NULL OR mp_check.has_insufficient_quantity THEN FALSE - ELSE TRUE - END AS is_valid - "), + CASE + WHEN mep.id IS NULL OR p.price IS NULL OR mp_check.has_insufficient_quantity THEN FALSE + ELSE TRUE + END AS is_valid + "), ]) ->where(['in', 'parent_id', $subQuery]) ->andFilterWhere(['p1n.id' => $productId]) @@ -89,19 +92,16 @@ class ReportAction extends Action ->orderBy(['is_valid' => SORT_ASC]) ->all(); - $dataProvider = new ArrayDataProvider([ 'allModels' => $products, 'pagination' => ['pageSize' => 20], ]); - return $this->controller->render('report', [ 'dataProvider' => $dataProvider, 'isValid' => $isValid, 'storeId' => $storeId, 'productId' => $productId, ]); - } } \ No newline at end of file diff --git a/erp24/views/marketplace/report.php b/erp24/views/marketplace/report.php index be7bfb9f..6db472f3 100644 --- a/erp24/views/marketplace/report.php +++ b/erp24/views/marketplace/report.php @@ -21,7 +21,7 @@ $this->params['breadcrumbs'][] = $this->title;

title) ?>

- + 'get']) ?>
params['breadcrumbs'][] = $this->title; 'value' => $storeId, 'data' => CityStore::getAllActiveGuidName(), 'options' => [ - 'required' => true, + 'required' => true, 'placeholder' => 'Выберите магазин', ], 'pluginOptions' => [ -- 2.39.5