From a480c5ca1dbe8ccb260c70bf94536898cec6cc02 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Tue, 26 Nov 2019 19:59:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=A1=A8=E5=8D=95=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=97=B6=E5=A2=9E=E5=8A=A0validate()=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods/src/controllers/GoodsController.php | 4 +- .../antgoods/goods/src/views/goods/create.php | 26 +++--------- .../goods/src/views/goods/picture.php | 41 +++++++++++++++++++ 3 files changed, 48 insertions(+), 23 deletions(-) create mode 100644 vendor/antgoods/goods/src/views/goods/picture.php diff --git a/vendor/antgoods/goods/src/controllers/GoodsController.php b/vendor/antgoods/goods/src/controllers/GoodsController.php index eaca006..f405a98 100644 --- a/vendor/antgoods/goods/src/controllers/GoodsController.php +++ b/vendor/antgoods/goods/src/controllers/GoodsController.php @@ -82,7 +82,7 @@ class GoodsController extends Controller { $model = new Goods(); - if ($model->load(Yii::$app->request->post())) { + if ($model->load(Yii::$app->request->post()) && $model->validate()) { //商品封面图和商品详情图上传保存处理 $cover_image_id_str = $model->coverImageId; @@ -121,7 +121,7 @@ class GoodsController extends Controller $cover_image_old_id_arr = $model->image; $detail_image_old_id_arr = $model->detailImageId; - if ($model->load(Yii::$app->request->post())) { + if ($model->load(Yii::$app->request->post()) && $model->validate()) { //商品封面图和商品详情图上传保存处理 $cover_image_id_str = $model->coverImageId; diff --git a/vendor/antgoods/goods/src/views/goods/create.php b/vendor/antgoods/goods/src/views/goods/create.php index 4e98c8d..6736a1b 100644 --- a/vendor/antgoods/goods/src/views/goods/create.php +++ b/vendor/antgoods/goods/src/views/goods/create.php @@ -13,29 +13,13 @@ $this->params['breadcrumbs'][] = $this->title; Yii::$app->params['bsVersion'] = '4.x'; ?>