Authored by Rock Zhang

添加加价购商品的promotionId

... ... @@ -601,7 +601,7 @@ class Helpers
}
/**
* 格式化加价购商品
* 格式化加价购和赠品商品
*
* @param array $advanceGoods 加价购商品列表
* @param int $count 计商品件数
... ... @@ -615,6 +615,7 @@ class Helpers
$oneGoods = array();
foreach ($advanceGoods as $value) {
$gift = array();
$gift['promotionId'] = $value['promotion_id'];
$gift['promotionTitle'] = $value['promotion_title'];
foreach ($value['goods_list'] as $single) {
... ...
... ... @@ -189,7 +189,7 @@ class CartModel
$product = CartData::cartProductData($uid, $skn);
if (isset($product['code']) && $product['code'] === 200) {
$result['code'] = 200;
$result['data'] = self::procGoodsDetail($product['data']);
$result['data'] = self::procGoodsDetail($product['data'], $num);
}
return $result;
... ... @@ -575,9 +575,10 @@ class CartModel
* 处理购物车商品、加价购商品、赠品详情数据
*
* @param array $productData 要处理的商品数据
* @param int $num 购买数目
* @return array $data 处理之后的数据
*/
private static function procGoodsDetail($productData)
private static function procGoodsDetail($productData, $num = null)
{
$data = array();
... ... @@ -590,7 +591,9 @@ class CartModel
$data['price'] = $productData['market_price'];
$data['salePrice'] = $productData['sales_price'];
$data['storage'] = $productData['storage_sum'];
$data['num'] = $num;
if ($num !== null) {
$data['num'] = $num;
}
// 商品选择
if (isset($productData['goods_list'])) {
... ...