...
|
...
|
@@ -135,7 +135,7 @@ class CartModel |
|
|
* @param string $shoppingKey 未登录用户唯一识别码
|
|
|
* @return array 处理之后的数据的数据
|
|
|
*/
|
|
|
public static function selectGoods($uid, $skuList, $shoppingKey, $hasPromotion = false)
|
|
|
public static function selectGoods($uid, $skuList, $shoppingKey)
|
|
|
{
|
|
|
$result = array('code' => 400, 'message' => '出错啦~');
|
|
|
|
...
|
...
|
@@ -143,8 +143,11 @@ class CartModel |
|
|
if (empty($skuList)) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
$select = CartData::selectGoods($uid, $skuList, $shoppingKey,$hasPromotion);
|
|
|
$arr = json_decode($skuList, true);
|
|
|
$arr[0]['promotion_id'] = $arr[0]['hasPromotion'];
|
|
|
$hasPromotion = $arr[0]['hasPromotion'];
|
|
|
$skuList = json_encode($arr);
|
|
|
$select = CartData::selectGoods($uid, $skuList, $shoppingKey, $hasPromotion);
|
|
|
if ($select && isset($select['code'])) {
|
|
|
$result['code'] = $select['code'];
|
|
|
$result['message'] = $select['message'];
|
...
|
...
|
@@ -168,8 +171,7 @@ class CartModel |
|
|
$result = array('code' => 400, 'message' => '出错啦~');
|
|
|
|
|
|
// 处理sku
|
|
|
$sku_list = json_encode(array($sku => intval($count) ));
|
|
|
|
|
|
$sku_list = json_encode(array(array('product_sku'=>$sku,'buy_number'=>intval($count), 'promotion_id'=>$hasPromotion)));
|
|
|
$remove = CartData::removeFromCart($uid, $sku_list, $shoppingKey, $hasPromotion);
|
|
|
if ($remove && isset($remove['code'])) {
|
|
|
$result['code'] = $remove['code'];
|
...
|
...
|
|