From 04c5d69d8e9d7eff0e0231e9c7ab606c0750c937 Mon Sep 17 00:00:00 2001 From: marina Date: Thu, 20 Feb 2025 16:02:36 +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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erp24/controllers/BouquetController.php b/erp24/controllers/BouquetController.php index 4e876dbb..13fda34e 100644 --- a/erp24/controllers/BouquetController.php +++ b/erp24/controllers/BouquetController.php @@ -69,18 +69,19 @@ class BouquetController extends Controller { $model = new BouquetComposition(); + if (Yii::$app->request->isPost) { $data = Yii::$app->request->post(); $model->guid = DataHelper::createGuidMy('07'); $model->load($data); - if ($data['matrix_type_id']) { - BouquetCompositionMatrixTypeHistory::setData($data['matrix_type_id'], $model->id); - } if ($model->save()) { - $month = $data['month']; $year = $data['year']; + if ($data['matrix_type_id']) { + BouquetCompositionMatrixTypeHistory::setData($data['matrix_type_id'], $model->id); + } + $model->photo_bouquet = UploadedFile::getInstances($model, 'photo_bouquet'); if ($model->photo_bouquet) { Files::deleteAll(['file_type' => 'image', 'entity_id' => $model->id, 'entity' => BouquetComposition::PHOTO_BOUQUET]); @@ -132,11 +133,10 @@ class BouquetController extends Controller } } } - return $this->redirect(['view', 'id' => $model->id]); } } - + $availableItems = ArrayHelper::map( Products1c::find() ->where([ -- 2.39.5