|
|
@ -726,9 +726,9 @@ class StoreOrderCreateRepository extends StoreOrderRepository |
|
|
|
if ($integralRate > 0) { |
|
|
|
if ($integralRate > 0) { |
|
|
|
$productIntegralPrice = min(bcmul(bcmul($this->cartByPrice($cart), $cart['cart_num'], 2), $integralRate, 2), $cart['true_price']); |
|
|
|
$productIntegralPrice = min(bcmul(bcmul($this->cartByPrice($cart), $cart['cart_num'], 2), $integralRate, 2), $cart['true_price']); |
|
|
|
if ($productIntegralPrice > 0) { |
|
|
|
if ($productIntegralPrice > 0) { |
|
|
|
$productIntegral = ceil(bcdiv($productIntegralPrice, $sysIntegralConfig['integral_money'], 3)); |
|
|
|
$productIntegral = bcdiv($productIntegralPrice, $sysIntegralConfig['integral_money'], 3); |
|
|
|
if ($productIntegral <= $userIntegral) { |
|
|
|
if ($productIntegral <= $userIntegral) { |
|
|
|
$userIntegral = bcsub($userIntegral, $productIntegral, 0); |
|
|
|
$userIntegral = bcsub($userIntegral, $productIntegral, 2); |
|
|
|
//使用多少积分抵扣了多少金额 |
|
|
|
//使用多少积分抵扣了多少金额 |
|
|
|
$cart['integral'] = [ |
|
|
|
$cart['integral'] = [ |
|
|
|
'use' => $productIntegral, |
|
|
|
'use' => $productIntegral, |
|
|
@ -748,7 +748,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository |
|
|
|
$merchantCart['order']['true_price'] = bcsub($merchantCart['order']['true_price'], $cart['integral']['price'], 2); |
|
|
|
$merchantCart['order']['true_price'] = bcsub($merchantCart['order']['true_price'], $cart['integral']['price'], 2); |
|
|
|
|
|
|
|
|
|
|
|
$total_integral_price = bcadd($total_integral_price, $cart['integral']['price'], 2); |
|
|
|
$total_integral_price = bcadd($total_integral_price, $cart['integral']['price'], 2); |
|
|
|
$total_integral = bcadd($total_integral, $cart['integral']['use'], 0); |
|
|
|
$total_integral = bcadd($total_integral, $cart['integral']['use'], 2); |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -756,7 +756,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository |
|
|
|
$cart['integral'] = null; |
|
|
|
$cart['integral'] = null; |
|
|
|
} |
|
|
|
} |
|
|
|
unset($cart); |
|
|
|
unset($cart); |
|
|
|
$order_total_integral = bcadd($order_total_integral, $total_integral, 0); |
|
|
|
$order_total_integral = bcadd($order_total_integral, $total_integral, 2); |
|
|
|
$order_total_integral_price = bcadd($order_total_integral_price, $total_integral_price, 2); |
|
|
|
$order_total_integral_price = bcadd($order_total_integral_price, $total_integral_price, 2); |
|
|
|
|
|
|
|
|
|
|
|
$_pay_price = $merchantCart['order']['true_price']; |
|
|
|
$_pay_price = $merchantCart['order']['true_price']; |
|
|
@ -790,10 +790,10 @@ class StoreOrderCreateRepository extends StoreOrderRepository |
|
|
|
if ($giveIntegralFlag && !$order_type && $pay_price > 0) { |
|
|
|
if ($giveIntegralFlag && !$order_type && $pay_price > 0) { |
|
|
|
$total_give_integral = floor(bcmul($pay_price, $sysIntegralConfig['integral_order_rate'], 0)); |
|
|
|
$total_give_integral = floor(bcmul($pay_price, $sysIntegralConfig['integral_order_rate'], 0)); |
|
|
|
if ($total_give_integral > 0 && $svip_status && $svip_integral_rate > 0) { |
|
|
|
if ($total_give_integral > 0 && $svip_status && $svip_integral_rate > 0) { |
|
|
|
$total_give_integral = bcmul($svip_integral_rate, $total_give_integral, 0); |
|
|
|
$total_give_integral = bcmul($svip_integral_rate, $total_give_integral, 2); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
$order_total_give_integral = bcadd($total_give_integral, $order_total_give_integral, 0); |
|
|
|
$order_total_give_integral = bcadd($total_give_integral, $order_total_give_integral, 2); |
|
|
|
|
|
|
|
|
|
|
|
foreach ($fn as $callback) { |
|
|
|
foreach ($fn as $callback) { |
|
|
|
$callback(); |
|
|
|
$callback(); |
|
|
|