Authored by Rock Zhang

添加对修改购物车商品数据以及数目接口对传递商品sku以及sku的验证

Code Review By Rock Zhang
... ... @@ -311,11 +311,17 @@ class CartModel
{
$result = array('code' => 400, 'message' => '出错啦~');
do {
if (empty($sku)) {
braek;
}
$modify = CartData::modifyProductNum($uid, $sku, $increaseNum, $decreaseNum, $shoppingKey);
if ($modify && isset($modify['code'])) {
$result['code'] = $modify['code'];
$result['message'] = $modify['message'];
}
}while(0);
return $result;
}
... ... @@ -332,6 +338,11 @@ class CartModel
{
$result = array('code' => 400, 'message' => '出错啦~');
do {
if (empty($param['old_product_sku']) || empty($param['new_product_sku'])) {
break;
}
// 处理要更改的数据
$swapData = json_encode(array($param));
... ... @@ -340,6 +351,7 @@ class CartModel
$result['code'] = $modify['code'];
$result['message'] = $modify['message'];
}
}while(0);
return $result;
}
... ...