...
|
...
|
@@ -55,6 +55,7 @@ class CartModel |
|
|
// 调用接口,获取购物车数据
|
|
|
$cartData = CartData::cartData($uid, $shoppingKey);
|
|
|
|
|
|
// print_r($cartData); exit;
|
|
|
// 接口异常时,购物车置为空
|
|
|
if (empty($cartData['data'])) {
|
|
|
$result['isEmpty'] = true;
|
...
|
...
|
@@ -1393,17 +1394,23 @@ class CartModel |
|
|
private static function genProductAmount($promotionList, $default)
|
|
|
{
|
|
|
$result = $default;
|
|
|
|
|
|
// VIP价格
|
|
|
$vipAmount = null;
|
|
|
// 学生价
|
|
|
$stuAmount = null;
|
|
|
foreach ($promotionList as $value) {
|
|
|
if ($value['promotion'] === 'VIP优惠') {
|
|
|
$vipAmount = strtr($value['promotion_amount'], array('¥' => '', '-' => '', '+' => ''));
|
|
|
break;
|
|
|
} elseif ($value['promotion'] === '学生优惠') {
|
|
|
$stuAmount = strtr($value['promotion_amount'], array('¥' => '', '-' => '', '+' => ''));
|
|
|
}
|
|
|
}
|
|
|
if (null !== $vipAmount) {
|
|
|
$result = floatval($default) - floatval($vipAmount);
|
|
|
}
|
|
|
if (null !== $stuAmount) {
|
|
|
$result = floatval($default) - floatval($stuAmount);
|
|
|
}
|
|
|
$result = Helpers::transPrice($result);
|
|
|
|
|
|
return $result;
|
...
|
...
|
|