From e71848e3118adc5d5b9826ed96c38f75dedfb297 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Mon, 25 Nov 2019 09:59:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=B8=8A=E4=BC=A0=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=B0=81=E9=9D=A2=E5=9B=BE=E7=89=87=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/antgoods/goods/src/controllers/GoodsController.php | 6 +++--- vendor/antgoods/goods/src/models/ars/Goods.php | 6 +++--- vendor/antgoods/goods/src/views/goods/_form.php | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/vendor/antgoods/goods/src/controllers/GoodsController.php b/vendor/antgoods/goods/src/controllers/GoodsController.php index 66a8d41..9d7691d 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())) { - $file_id_str = $model->imageId; + $file_id_str = $model->coverImageId; $model->save(); $goods_manager = new GoodsManager(); $save_file_res = $goods_manager->saveFile(explode(',', $file_id_str), $model); @@ -108,11 +108,11 @@ class GoodsController extends Controller public function actionUpdate($id) { $model = $this->findModel($id); - $model->imageId = $model->image; + $model->coverImageId = $model->image; $old_id_arr = $model->image; if ($model->load(Yii::$app->request->post())) { - $file_id_str = $model->imageId; + $file_id_str = $model->coverImageId; $model->save(); $goods_manager = new GoodsManager(); $save_file_res = $goods_manager->saveFile(explode(',', $file_id_str), $model, explode(',', $old_id_arr)); diff --git a/vendor/antgoods/goods/src/models/ars/Goods.php b/vendor/antgoods/goods/src/models/ars/Goods.php index ad00d9c..6dd092c 100644 --- a/vendor/antgoods/goods/src/models/ars/Goods.php +++ b/vendor/antgoods/goods/src/models/ars/Goods.php @@ -44,8 +44,8 @@ use yii\behaviors\TimestampBehavior; */ class Goods extends \yii\db\ActiveRecord { - public $imagePath; - public $imageId; + public $coverImagePath; + public $coverImageId; //是否删除is_delete const IS_DELETE_NO = 0;//未删除 const IS_DELETE_YES = 1;//已删除 @@ -73,7 +73,7 @@ class Goods extends \yii\db\ActiveRecord [['pid', 'cat_id', 'brand_id', 'shop_cat_id', 'supplier_id', 'weight', 'length', 'width', 'height', 'diameter', 'sold_count', 'limit_count', 'stock', 'stock_warn', 'market_price', 'price', 'image', 'model_id', 'is_sale', 'sort_order', 'bouns_points', 'experience_points', 'is_delete', 'express_template'], 'integer'], [['cat_id', 'brand_id', 'shop_cat_id', 'name'], 'required'], [['sn'], 'checkExist'], - [['description', 'imageId'], 'string'], + [['description', 'coverImageId'], 'string'], [['name'], 'string', 'max' => 120], [['sn'], 'string', 'max' => 60], [['code'], 'string', 'max' => 50], diff --git a/vendor/antgoods/goods/src/views/goods/_form.php b/vendor/antgoods/goods/src/views/goods/_form.php index 8fbbe82..d9db444 100644 --- a/vendor/antgoods/goods/src/views/goods/_form.php +++ b/vendor/antgoods/goods/src/views/goods/_form.php @@ -69,17 +69,17 @@ use yii\helpers\Url; field($model, 'express_template')->textInput() ?> - field($model, 'imageId')->textInput()->label('') ?> - field($model, 'imagePath')->widget(\iron\widgets\Upload::className(), [ + field($model, 'coverImageId')->textInput()->label('') ?> + field($model, 'coverImagePath')->widget(\iron\widgets\Upload::className(), [ 'url' => 'upload', 'deleteUrl' => 'img-id-del', 'dragdropWidth'=> 800, 'afterSave' => 'save-file', 'maxCount' => 1, - 'fillInAttribute' => 'imageId', + 'fillInAttribute' => 'coverImageId', 'model' => $model, 'previewConfig' => [ - 'url' => Url::to(['image-file', 'fileidstr' => $model->imageId]), + 'url' => Url::to(['image-file', 'fileidstr' => $model->coverImageId]), ], ])->label('图片') ?>