|
|
@@ -41,7 +41,7 @@ class StoreCart extends BaseModel
|
|
|
return time();
|
|
|
}
|
|
|
|
|
|
- public static function setCart($uid, $product_id, $cart_num = 1, $product_attr_unique = '', $type = 'product', $is_new = 0, $combination_id = 0, $seckill_id = 0, $bargain_id = 0,$is_gold=0,$is_integral=0)
|
|
|
+ public static function setCart($uid, $product_id, $cart_num = 1, $product_attr_unique = '', $type = 'product', $is_new = 0, $combination_id = 0, $seckill_id = 0, $bargain_id = 0,$is_gold=0,$is_integral=0,$is_beauty=0)
|
|
|
{
|
|
|
if ($cart_num < 1) $cart_num = 1;
|
|
|
if (!$product_attr_unique) {
|
|
|
@@ -75,7 +75,7 @@ class StoreCart extends BaseModel
|
|
|
return $cart;
|
|
|
} else {
|
|
|
$add_time = time();
|
|
|
- return self::create(compact('uid', 'product_id', 'cart_num', 'product_attr_unique', 'is_new', 'type', 'combination_id', 'add_time', 'bargain_id', 'seckill_id','is_gold','is_integral'));
|
|
|
+ return self::create(compact('uid', 'product_id', 'cart_num', 'product_attr_unique', 'is_new', 'type', 'combination_id', 'add_time', 'bargain_id', 'seckill_id','is_gold','is_integral','is_beauty'));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -214,8 +214,16 @@ class StoreCart extends BaseModel
|
|
|
}
|
|
|
$cart['vip_truePrice'] = 0;
|
|
|
} else {
|
|
|
- $cart['truePrice'] = (float)StoreProduct::setLevelPrice($attrInfo['price'], $uid, true);
|
|
|
- $cart['vip_truePrice'] = (float)StoreProduct::setLevelPrice($attrInfo['price'], $uid);
|
|
|
+ if($cart['is_beauty']) {
|
|
|
+ $cart['truePrice'] = (float)StoreProduct::setLevelPrice($attrInfo['price'], $uid, true);
|
|
|
+ $cart['vip_truePrice'] = (float)StoreProduct::setLevelPrice($attrInfo['price'], $uid);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $cart['truePrice'] = $attrInfo['price'];
|
|
|
+ $cart['vip_truePrice'] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
$cart['trueStock'] = $attrInfo['stock'];
|
|
|
$cart['costPrice'] = $attrInfo['cost'];
|
|
|
@@ -223,7 +231,7 @@ class StoreCart extends BaseModel
|
|
|
$valid[] = $cart;
|
|
|
}
|
|
|
} else {
|
|
|
- if ($cart['combination_id'] || $cart['seckill_id'] || $cart['bargain_id'] || $cart['is_gold']) {
|
|
|
+ if ($cart['combination_id'] || $cart['seckill_id'] || $cart['bargain_id'] || $cart['is_gold'] || $cart['is_integral']) {
|
|
|
$cart['truePrice'] = $cart['productInfo']['price'];
|
|
|
$cart['vip_truePrice'] = 0;
|
|
|
if ($cart['bargain_id']) {
|
|
|
@@ -232,8 +240,15 @@ class StoreCart extends BaseModel
|
|
|
$cart['productInfo']['attrInfo']['weight'] = $product['weight'];
|
|
|
$cart['productInfo']['attrInfo']['volume'] = $product['volume'];
|
|
|
} else {
|
|
|
- $cart['truePrice'] = (float)StoreProduct::setLevelPrice($cart['productInfo']['price'], $uid, true);
|
|
|
- $cart['vip_truePrice'] = (float)StoreProduct::setLevelPrice($cart['productInfo']['price'], $uid);
|
|
|
+ if($cart['is_beauty']) {
|
|
|
+ $cart['truePrice'] = (float)StoreProduct::setLevelPrice($cart['productInfo']['price'], $uid, true);
|
|
|
+ $cart['vip_truePrice'] = (float)StoreProduct::setLevelPrice($cart['productInfo']['price'], $uid);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $cart['truePrice'] = $attrInfo['price'];
|
|
|
+ $cart['vip_truePrice'] = 0;
|
|
|
+ }
|
|
|
}
|
|
|
$cart['trueStock'] = $cart['productInfo']['stock'];
|
|
|
$cart['costPrice'] = $cart['productInfo']['cost'];
|