...
|
...
|
@@ -179,6 +179,41 @@ class CartData |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 增减购物车商品数量
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param string $sku 商品SKU
|
|
|
* @param int $increaseNum 增加的数目
|
|
|
* @param int $decreaseNum 减少的数目
|
|
|
* @param string $shoppingKey 未登录用户唯一识别码
|
|
|
* @return array 接口返回的数据
|
|
|
*/
|
|
|
public static function modifyProductNum($uid, $sku, $increaseNum, $decreaseNum, $shoppingKey)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.Shopping.increase';
|
|
|
$param['product_sku'] = $sku;
|
|
|
|
|
|
if (!empty($increaseNum)) {
|
|
|
$param['increase_number'] = $increaseNum;
|
|
|
}
|
|
|
if (!empty($decreaseNum)) {
|
|
|
$param['decrease_number'] = $decreaseNum;
|
|
|
}
|
|
|
|
|
|
if (!empty($uid)) {
|
|
|
$param['uid'] = $uid;
|
|
|
}
|
|
|
if ($shoppingKey !== null) {
|
|
|
$param['shopping_key'] = $shoppingKey;
|
|
|
}
|
|
|
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::API_URL, $param);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改购物车商品数据
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
...
|
...
|
|