更新
This commit is contained in:
parent
b952ba45aa
commit
479226fd1a
@ -225,6 +225,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
}
|
||||
$svip_discount = 0;
|
||||
$realPrice = $this->cartByPrice($cart);
|
||||
$procure = $this->cartByPrice($cart,1);
|
||||
if (in_array($source,[9,10,11,12,13])) {
|
||||
if($realPrice==0){
|
||||
throw new ValidateException('价格必须大于0');
|
||||
@ -234,6 +235,8 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
$cart['productAttr']['stock'] = $cart['cart_num'];
|
||||
}
|
||||
$price = bcmul($cart['cart_num'], $realPrice, 2);
|
||||
$procure_price = bcmul($cart['cart_num'], $procure, 2);
|
||||
$cart['procure_price'] = $procure_price;
|
||||
$cart['total_price'] = $price;
|
||||
$cart['postage_price'] = 0;
|
||||
$cart['svip_discount'] = 0;
|
||||
|
@ -531,7 +531,7 @@ class StoreOrderRepository extends BaseRepository
|
||||
}
|
||||
}
|
||||
|
||||
public function cartByPrice($cart)
|
||||
public function cartByPrice($cart,$type=0)
|
||||
{
|
||||
if ($cart['product_type'] == '2') {
|
||||
return $cart['productPresellAttr']['presell_price'];
|
||||
@ -554,8 +554,12 @@ class StoreOrderRepository extends BaseRepository
|
||||
// } else {
|
||||
// return $cart['productAttr']['price'];
|
||||
// }
|
||||
if (in_array($cart['source'],[9,10,11,12,13])) {
|
||||
return $cart['productAttr']['procure_price'];
|
||||
if (in_array($cart['source'],[9,10,11,12,13,103])) {
|
||||
if($type==0){
|
||||
return $cart['productAttr']['price'];
|
||||
}else{
|
||||
return $cart['productAttr']['procure_price'];
|
||||
}
|
||||
} else {
|
||||
return $cart['productAttr']['price'];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user