|
|
@ -152,6 +152,8 @@ class Goods extends Controller |
|
|
|
$model = new GoodsModel; |
|
|
|
$model = new GoodsModel; |
|
|
|
$postform = $this->postForm(); |
|
|
|
$postform = $this->postForm(); |
|
|
|
$postform['merchant_id'] = $this->merchantId; |
|
|
|
$postform['merchant_id'] = $this->merchantId; |
|
|
|
|
|
|
|
//处理子商城之后,设置store_id为0的情况 |
|
|
|
|
|
|
|
$postform['store_id'] = $this->storeId; |
|
|
|
if ($model->add($postform)) { |
|
|
|
if ($model->add($postform)) { |
|
|
|
return $this->renderSuccess('添加成功'); |
|
|
|
return $this->renderSuccess('添加成功'); |
|
|
|
} |
|
|
|
} |
|
|
@ -172,6 +174,7 @@ class Goods extends Controller |
|
|
|
// 商品详情 |
|
|
|
// 商品详情 |
|
|
|
$model = GoodsModel::detail($goodsId); |
|
|
|
$model = GoodsModel::detail($goodsId); |
|
|
|
$params = $this->postForm(); |
|
|
|
$params = $this->postForm(); |
|
|
|
|
|
|
|
|
|
|
|
if ($model->isEmpty()) { |
|
|
|
if ($model->isEmpty()) { |
|
|
|
return $this->renderError("该商品已不存在!"); |
|
|
|
return $this->renderError("该商品已不存在!"); |
|
|
|
} |
|
|
|
} |
|
|
@ -184,8 +187,9 @@ class Goods extends Controller |
|
|
|
// echo "<pre>"; |
|
|
|
// echo "<pre>"; |
|
|
|
// print_r($params); |
|
|
|
// print_r($params); |
|
|
|
// print_r($model->toArray()); |
|
|
|
// print_r($model->toArray()); |
|
|
|
// exit(); |
|
|
|
//exit(); |
|
|
|
$params['data_type'] = $model->data_type; |
|
|
|
$params['data_type'] = $model->data_type; |
|
|
|
|
|
|
|
//$params['store_id'] = $this->storeId; |
|
|
|
// 更新记录 |
|
|
|
// 更新记录 |
|
|
|
if ($model->edit($params)) { |
|
|
|
if ($model->edit($params)) { |
|
|
|
return $this->renderSuccess('更新成功'); |
|
|
|
return $this->renderSuccess('更新成功'); |
|
|
|