From d0fa82837a803abc447a49362d3c983bbcc0c381 Mon Sep 17 00:00:00 2001 From: marina Date: Wed, 19 Feb 2025 15:26:34 +0300 Subject: [PATCH] =?utf8?q?ERP-302=20=D0=A0=D0=B5=D0=B4=D0=B0=D0=BA=D1=82?= =?utf8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B1=D1=83?= =?utf8?q?=D0=BA=D0=B5=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/BouquetController.php | 9 ++++---- erp24/views/bouquet/_form.php | 30 +++++++++++++------------ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/erp24/controllers/BouquetController.php b/erp24/controllers/BouquetController.php index d7015e4a..2a67a63d 100644 --- a/erp24/controllers/BouquetController.php +++ b/erp24/controllers/BouquetController.php @@ -231,7 +231,7 @@ class BouquetController extends Controller if (Yii::$app->request->isPost) { try { - if (array_key_exists('products_quantity', Yii::$app->request->post())) { + if (Yii::$app->request->post('products_quantity')) { $bouquetProducts = Yii::$app->request->post('products_quantity'); foreach ($bouquetProducts as $key => $value) { $product = new BouquetCompositionProducts([ @@ -242,14 +242,13 @@ class BouquetController extends Controller $product->save(); } - return $this->redirect('view', [ - 'model' => $model - ]); + return $this->redirect(['view', 'id' => $id]); } } catch (Exception $exception) { - throw new NotFoundHttpException($exception); + throw new NotFoundHttpException($exception->getMessage()); } } + $products = BouquetCompositionProducts::find() ->where(['bouquet_id' => $model->id]) ->with('product') diff --git a/erp24/views/bouquet/_form.php b/erp24/views/bouquet/_form.php index 9cb3cfd8..afeb9b5b 100644 --- a/erp24/views/bouquet/_form.php +++ b/erp24/views/bouquet/_form.php @@ -73,7 +73,8 @@ $form = ActiveForm::begin([
@@ -89,7 +90,7 @@ $form = ActiveForm::begin([
ср.шт. в сборке
-
+
product->name ?>
@@ -101,20 +102,21 @@ $form = ActiveForm::begin([
-
-
- Нижегородская область -
- - Себестоимость: getSelfCost()?>
- Наценка: getMarkUp() ?>
- Цена: getCost() ?>
+ +
+
+ Нижегородская область +
+ Себестоимость: getSelfCost() ?>
+ Наценка: getMarkUp() ?>
+ Цена: getCost() ?>
+
+
+
+ id"), ['class' => $model ? 'btn btn-warning w-100' : 'btn btn-warning w-100 disabled']) ?>
-
- id") : Url::to("#"), ['class' => $model ? 'btn btn-warning w-100' : 'btn btn-warning w-100 disabled']) ?> -
-
+
-- 2.39.5