...
|
...
|
@@ -85,7 +85,7 @@ class Cart extends Api |
|
|
$post['goods_style'] = json_encode($post['goods_style']);
|
|
|
}
|
|
|
if(!$cart_id = $this->model->add($this->user,$post)){
|
|
|
$this->error($this->model->getError() ?: '加入购物车失败');
|
|
|
$this->error($this->model->getError() ?: '加入购物车失败',null,$this->model->getCode());
|
|
|
}
|
|
|
$this->success(__('加入购物车成功'),[
|
|
|
'cart_id' => $cart_id,
|
...
|
...
|
@@ -191,6 +191,7 @@ class Cart extends Api |
|
|
})
|
|
|
*/
|
|
|
public function editGoodsNum($cart_id,$goods_num){
|
|
|
halt($cart_id);
|
|
|
$cart = $this->model->get($cart_id);
|
|
|
empty($cart) && $this->error(__('购物车信息不存在'));
|
|
|
$goods_num < 1 && $this->error(__('商品数量不能小于1'));
|
...
|
...
|
|