|
|
@@ -178,7 +178,7 @@ class StoreCart extends BaseModel
|
|
|
|
|
|
public static function getUserProductCartList($uid, $cartIds = '', $status = 0, $store_id = 0)
|
|
|
{
|
|
|
- $productInfoField = 'id,image,price,ot_price,vip_price,postage,give_integral,sales,stock,store_name,unit_name,is_show,is_del,is_postage,cost,is_sub,temp_id,is_consumer,is_suit,is_bind,max_use_integral,store_id,store_bag';
|
|
|
+ $productInfoField = 'id,image,price,ot_price,vip_price,postage,give_integral,sales,stock,store_name,unit_name,is_show,is_del,is_postage,cost,is_sub,temp_id,is_consumer,is_suit,is_bind,max_use_integral,store_id,store_bag,time_area_discount';
|
|
|
$seckillInfoField = 'id,image,price,ot_price,postage,give_integral,sales,stock,title as store_name,unit_name,is_show,is_del,is_postage,cost,temp_id,weight,volume,start_time,stop_time,time_id';
|
|
|
$bargainInfoField = 'id,image,min_price as price,price as ot_price,postage,give_integral,sales,stock,title as store_name,unit_name,status as is_show,is_del,is_postage,cost,temp_id,weight,volume';
|
|
|
$combinationInfoField = 'id,image,price,postage,sales,stock,title as store_name,is_show,is_del,is_postage,cost,temp_id,weight,volume';
|
|
|
@@ -266,6 +266,24 @@ class StoreCart extends BaseModel
|
|
|
} else {
|
|
|
$cart['truePrice'] = (float)StoreProduct::setLevelPrice($attrInfo['price'], $uid, true);
|
|
|
$cart['vip_truePrice'] = (float)StoreProduct::setLevelPrice($attrInfo['price'], $uid);
|
|
|
+
|
|
|
+ $discounts = json_decode($product['time_area_discount'], true);
|
|
|
+ $discount = 0;
|
|
|
+ foreach ($discounts as $kk => $v) {
|
|
|
+ $times = explode('-', $kk);
|
|
|
+ if (!(count($times) == 2)) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $start = strtotime(date('Y-m-d') . $times[0]);
|
|
|
+ $end = strtotime(date('Y-m-d') . $times[1]);
|
|
|
+ if (time() > $start && time() <= $end) {
|
|
|
+ $discount = $v;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($discount > 0) {
|
|
|
+ $cart['truePrice'] = bcmul(bcdiv($discount, 100, 4), $cart['truePrice'], 2);
|
|
|
+ $cart['vip_truePrice'] = bcsub($cart['truePrice'], bcmul(bcdiv($discount, 100, 4), $cart['truePrice'], 2), 2);
|
|
|
+ }
|
|
|
$cart['use_integral'] = 0;
|
|
|
}
|
|
|
$cart['trueStock'] = $attrInfo['stock'];
|