Browse Source

处理物流信息创建更改逻辑

antshop
linyaostalker 5 years ago
parent
commit
67c8ca9f71
  1. 11
      backend/modules/goods/controllers/GoodsController.php

11
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();

Loading…
Cancel
Save