...
|
...
|
@@ -23,7 +23,7 @@ class CartModel |
|
|
* @param int $productSku 商品SKU
|
|
|
* @param int $buyNumber 购买数量
|
|
|
* @param int $goodsType 商品类型,0表示普通商品,1表示加价购商品
|
|
|
* @param int int $isEdit 是否是编辑商品SKU,0表示不是编辑
|
|
|
* @param int $isEdit 是否是编辑商品SKU,0表示不是编辑
|
|
|
* @param null|int $promotionId 促销id,默认null(加价购有关)
|
|
|
* @param null|int $uid 用户UID,可以不传
|
|
|
* @return array 加入购物车接口返回的数据
|
...
|
...
|
@@ -406,7 +406,7 @@ class CartModel |
|
|
$oneGoods['name'] = $single['product_name'];
|
|
|
$oneGoods['color'] = $single['color_name'];
|
|
|
$oneGoods['size'] = $single['size_name'];
|
|
|
$oneGoods['price'] = Helpers::transPrice($single['real_price']); // last_price有些带.00,有些不带,real_price都不带.00
|
|
|
$oneGoods['price'] = Helpers::transPrice($single['sales_price']);
|
|
|
$oneGoods['count'] = $single['buy_number'];
|
|
|
|
|
|
$result['goods'][] = $oneGoods;
|
...
|
...
|
@@ -428,18 +428,20 @@ class CartModel |
|
|
}
|
|
|
|
|
|
// 有货币
|
|
|
$result['yohoCoin'] = isset($orderCompute['use_yoho_coin']) ? isset($orderCompute['use_yoho_coin']) : $payReturn['yoho_coin'];
|
|
|
$result['yohoCoin'] = (isset($orderCompute['use_yoho_coin']) && !empty($orderCompute['use_yoho_coin'])) ? $orderCompute['use_yoho_coin'] : $payReturn['yoho_coin'];
|
|
|
|
|
|
// 订单数据
|
|
|
if (isset($payReturn['shopping_cart_data']) && !empty($payReturn['shopping_cart_data'])) {
|
|
|
$sumPrice = isset($orderCompute['order_amount']) ? $orderCompute['order_amount'] : $payReturn['shopping_cart_data']['order_amount'];
|
|
|
$salePrice = isset($orderCompute['discount_amount']) ? $orderCompute['discount_amount'] : $payReturn['shopping_cart_data']['discount_amount'];
|
|
|
$freight = isset($orderCompute['promotion_formula_list']['promotion_amount']) ? $orderCompute['promotion_formula_list'][1]['promotion_amount'] : $payReturn['shopping_cart_data']['promotion_formula_list'][1]['promotion_amount'];
|
|
|
$couponPrice = isset($orderCompute['coupon_amount']) ? $orderCompute['coupon_amount'] : false;
|
|
|
$salePrice = isset($orderCompute['discount_amount']) ? $orderCompute['discount_amount'] : $payReturn['shopping_cart_data']['promotion_formula_list'][3]['promotion_amount'];
|
|
|
$price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount'];
|
|
|
$freight = isset($orderCompute['promotion_formula_list']['promotion_amount']) ? $orderCompute['promotion_formula_list']['promotion_amount'] : $payReturn['shopping_cart_data']['promotion_formula_list'][1]['promotion_amount'];
|
|
|
$result['sumPrice'] = Helpers::transPrice($sumPrice);
|
|
|
$result['salePrice'] = Helpers::transPrice($salePrice);
|
|
|
$result['price'] = Helpers::transPrice($price);
|
|
|
$result['freight'] = strtr($freight, array('¥'=>'','¥'=>'')) . '.00';
|
|
|
$result['freight'] = $freight;
|
|
|
$result['couponPrice'] = $couponPrice;
|
|
|
}
|
|
|
|
|
|
// 发票有关数据
|
...
|
...
|
@@ -468,7 +470,7 @@ class CartModel |
|
|
// 优惠券数据
|
|
|
$coupons = array();
|
|
|
!empty($orderCompute['coupon_amount']) && $coupons['value'] = $orderInfo['couponValue'];
|
|
|
$coupons += self::getCouponList($uid, 0, 1, true);
|
|
|
$coupons += self::getCouponList($uid, true);
|
|
|
$result['coupon'] = $coupons;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -535,7 +537,7 @@ class CartModel |
|
|
if (isset($coupons['data'])) {
|
|
|
|
|
|
if ($onlyTotal) {
|
|
|
$result['count'] = $coupons['data']['total'];
|
|
|
$result['count'] = count($coupons['data']['couponList']);
|
|
|
} else {
|
|
|
$couponArr = array();
|
|
|
isset($coupons['data']['couponList']) && $couponArr = $coupons['data']['couponList'];
|
...
|
...
|
@@ -605,7 +607,6 @@ class CartModel |
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
$oneGoods = array();
|
|
|
// 购买的可用商品列表
|
|
|
$validGoods = Helpers::formatCartGoods($data['goods_list']);
|
|
|
!empty($validGoods) && $result['goods'] = $validGoods;
|
...
|
...
|
|