|
|
@@ -174,6 +174,7 @@ class StoreCart extends BaseModel
|
|
|
if (!count($list)) return compact('valid', 'invalid');
|
|
|
$now = time();
|
|
|
$type_wholesale=1;
|
|
|
+ $agent_product_id = 0;
|
|
|
foreach ($list as $k => $cart) {
|
|
|
if ($cart['seckill_id']) {
|
|
|
$product = StoreSeckill::field($seckillInfoField)
|
|
|
@@ -208,6 +209,7 @@ class StoreCart extends BaseModel
|
|
|
|
|
|
if (isset($product['is_wholesale'])&&$product['is_wholesale'] == 1){ //是否有批发商品
|
|
|
$type_wholesale = 2;
|
|
|
+ $agent_product_id = $product['id'];
|
|
|
}
|
|
|
if ($cart['seckill_id']) {
|
|
|
$config = SystemGroupData::get($product['time_id']);
|
|
|
@@ -241,8 +243,8 @@ class StoreCart extends BaseModel
|
|
|
$cart['truePrice'] = $attrInfo['price'];
|
|
|
$cart['vip_truePrice'] = 0;
|
|
|
} else {
|
|
|
- $cart['truePrice'] = (float)StoreProduct::setLevelPrice($attrInfo['price'], $uid, true,$type_wholesale);
|
|
|
- $cart['vip_truePrice'] = (float)StoreProduct::setLevelPrice($attrInfo['price'], $uid,false,$type_wholesale);
|
|
|
+ $cart['truePrice'] = (float)StoreProduct::setLevelPrice($attrInfo['price'], $uid, true,$type_wholesale,$agent_product_id);
|
|
|
+ $cart['vip_truePrice'] = (float)StoreProduct::setLevelPrice($attrInfo['price'], $uid,false,$type_wholesale,$agent_product_id);
|
|
|
}
|
|
|
$cart['trueStock'] = $attrInfo['stock'];
|
|
|
$cart['costPrice'] = $attrInfo['cost'];
|
|
|
@@ -260,8 +262,8 @@ 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,$type_wholesale);
|
|
|
- $cart['vip_truePrice'] = (float)StoreProduct::setLevelPrice($cart['productInfo']['price'], $uid,false,$type_wholesale);
|
|
|
+ $cart['truePrice'] = (float)StoreProduct::setLevelPrice($cart['productInfo']['price'], $uid, true,$type_wholesale,$agent_product_id);
|
|
|
+ $cart['vip_truePrice'] = (float)StoreProduct::setLevelPrice($cart['productInfo']['price'], $uid,false,$type_wholesale,$agent_product_id);
|
|
|
}
|
|
|
$cart['trueStock'] = $cart['productInfo']['stock'];
|
|
|
$cart['costPrice'] = $cart['productInfo']['cost'];
|