From 67c8ca9f71c65a2de115dfced8615a57a97375be Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Sat, 7 Dec 2019 09:59:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=89=A9=E6=B5=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=88=9B=E5=BB=BA=E6=9B=B4=E6=94=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/goods/controllers/GoodsController.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/modules/goods/controllers/GoodsController.php b/backend/modules/goods/controllers/GoodsController.php index e0d4833..26b63ec 100755 --- a/backend/modules/goods/controllers/GoodsController.php +++ b/backend/modules/goods/controllers/GoodsController.php @@ -96,7 +96,11 @@ class GoodsController extends Controller $model = new Goods(); $model->is_sale = Goods::IS_SALE_YES; $model->stock = -1; + $model->is_taking = Goods::IS_TAKING_NO; + $model->is_express = Goods::IS_EXPRESS_YES; + $model->express_type = Goods::EXPRESS_TYPE_EXPRESS_TEMPLAGE; if ($model->load(Yii::$app->request->post()) && $model->validate()) { + $model->uniform_postage *= 100; //商品封面图和商品详情图上传保存处理 $res = GoodsManager::updateGoods(Yii::$app->request->post(), $model); if ($res['status']) { @@ -126,12 +130,14 @@ class GoodsController extends Controller $cover_image_old_id_str = $model->image; $detail_image_old_id_str = $model->detailImageId; if ($model->load(Yii::$app->request->post()) && $model->validate()) { + $model->uniform_postage *= 100; //商品封面图和商品详情图上传保存处理 $res = GoodsManager::updateGoods(Yii::$app->request->post(), $model, $cover_image_old_id_str, $detail_image_old_id_str); if ($res['status']) { return $this->redirect('index'); } } + $model->uniform_postage /= 100; $attributeModel = GoodsManager::getAttribute($id); $checkAttr = GoodsManager::getSkuInfo($id); $filterAttributeModel = GoodsManager::getFilterAttribute($id); @@ -211,10 +217,7 @@ class GoodsController extends Controller $model->user_id = Yii::$app->user->identity->id; $model->name = $file_name; $file_manager = new \backend\modules\file\logic\file\FileManager(); - $type_res = $file_manager->searchType(\backend\modules\file\logic\file\FileManager::$extension, pathinfo($data['path'])['extension']); - if ($type_res['status']) { - $model->type = $type_res['type']; - } + $model->type = $file_manager->searchType(pathinfo($data['path'])['extension']); $model->alias = $data['alias']; $model->path = $data['path']; $model->save();