...
|
...
|
@@ -135,7 +135,7 @@ class CartModel |
|
|
* @param string $shoppingKey 未登录用户唯一识别码
|
|
|
* @return array 处理之后的数据的数据
|
|
|
*/
|
|
|
public static function selectGoods($uid, $skuList, $shoppingKey)
|
|
|
public static function selectGoods($uid, $skuList, $shoppingKey, $hasPromotion = false)
|
|
|
{
|
|
|
$result = array('code' => 400, 'message' => '出错啦~');
|
|
|
|
...
|
...
|
@@ -144,7 +144,7 @@ class CartModel |
|
|
break;
|
|
|
}
|
|
|
|
|
|
$select = CartData::selectGoods($uid, $skuList, $shoppingKey);
|
|
|
$select = CartData::selectGoods($uid, $skuList, $shoppingKey,$hasPromotion);
|
|
|
if ($select && isset($select['code'])) {
|
|
|
$result['code'] = $select['code'];
|
|
|
$result['message'] = $select['message'];
|
...
|
...
|
@@ -163,14 +163,14 @@ class CartModel |
|
|
* @param string $shoppingKey 未登录用户唯一识别码
|
|
|
* @return array 接口返回的数据
|
|
|
*/
|
|
|
public static function removeFromCart($uid, $sku, $count, $shoppingKey)
|
|
|
public static function removeFromCart($uid, $sku, $count, $shoppingKey, $hasPromotion = false)
|
|
|
{
|
|
|
$result = array('code' => 400, 'message' => '出错啦~');
|
|
|
|
|
|
// 处理sku
|
|
|
$sku_list = json_encode(array($sku => intval($count) ));
|
|
|
|
|
|
$remove = CartData::removeFromCart($uid, $sku_list, $shoppingKey);
|
|
|
$remove = CartData::removeFromCart($uid, $sku_list, $shoppingKey, $hasPromotion);
|
|
|
if ($remove && isset($remove['code'])) {
|
|
|
$result['code'] = $remove['code'];
|
|
|
$result['message'] = $remove['message'];
|
...
|
...
|
@@ -186,7 +186,7 @@ class CartModel |
|
|
* @param string $sku 商品sku列表
|
|
|
* @return array 接口返回的数据
|
|
|
*/
|
|
|
public static function addToFav($uid, $sku)
|
|
|
public static function addToFav($uid, $sku, $hasPromotion = false)
|
|
|
{
|
|
|
$result = array('code' => 400, 'message' => '出错啦~');
|
|
|
|
...
|
...
|
@@ -201,7 +201,7 @@ class CartModel |
|
|
// 处理sku
|
|
|
$sku_list = json_encode(array($sku => 1));
|
|
|
|
|
|
$add = CartData::addToFav($uid, $sku_list);
|
|
|
$add = CartData::addToFav($uid, $sku_list, $hasPromotion);
|
|
|
if ($add && isset($add['code'])) {
|
|
|
$result['code'] = $add['code'];
|
|
|
$result['message'] = $add['message'];
|
...
|
...
|
|