From 33cc3efc7ba4ff500fc5046a3e33f2668c86b814 Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Wed, 22 Jun 2022 11:44:37 +1000 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D1=87=D0=B8=D0=BD=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B8=D0=B7=D0=BE=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=B6=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=B8=20=D0=B0=D1=80=D1=82?= =?UTF-8?q?=D0=B8=D0=BA=D1=83=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mirzaev/skillparts/system/controllers/ProductController.php | 6 +++--- mirzaev/skillparts/system/views/product/index.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mirzaev/skillparts/system/controllers/ProductController.php b/mirzaev/skillparts/system/controllers/ProductController.php index 0656eb1..3b2ba50 100644 --- a/mirzaev/skillparts/system/controllers/ProductController.php +++ b/mirzaev/skillparts/system/controllers/ProductController.php @@ -604,7 +604,7 @@ class ProductController extends Controller // Товар обновлён $return['main'] = $this->renderPartial('index', compact('model')); - $return['redirect'] = '/product/' . $model->catn; + $return['redirect'] = "/product/$model->prod/$model->catn"; } } @@ -790,7 +790,7 @@ class ProductController extends Controller } } - public function actionWriteImage(string $catn): array|string|null + public function actionWriteImage(string $prod, string $catn): array|string|null { // Инициализация $return = [ @@ -847,7 +847,7 @@ class ProductController extends Controller ]; $index = yii::$app->request->post('index') ?? yii::$app->request->get('index'); - if (empty($catn) || empty($index) || empty($prod)) { + if (empty($catn) || !isset($index) || empty($prod)) { // Не получены обязательные параметры yii::$app->response->statusCode = 500; diff --git a/mirzaev/skillparts/system/views/product/index.php b/mirzaev/skillparts/system/views/product/index.php index 9b56fc9..0bb60fd 100644 --- a/mirzaev/skillparts/system/views/product/index.php +++ b/mirzaev/skillparts/system/views/product/index.php @@ -67,7 +67,7 @@ use app\models\Product; // Инициализация $checked = ''; - foreach (!empty($model['imgs']) && is_array($model['imgs']) ? $model['imgs'] : [] as $key => $image) { + foreach (!empty($model['imgs']) && is_array($model['imgs']) ? $model['imgs'] : [null] as $key => $image) { // Перебор изображений для генерации полных версий // Инициализация