修改订单金额的错误

This commit is contained in:
luofei 2024-01-27 10:18:34 +08:00
parent ba205d9954
commit 529c2cbd1a

View File

@ -590,13 +590,6 @@ class StoreOrderCreateRepository extends StoreOrderRepository
} else {
$pay_price = $org_price;
}
//计算总红包金额
if ($source == 105) {
$this->consumption_money = bcsub($pay_price, 2, 2);
$pay_price =2; ;
$this->balance = 0;
$consumption_coupon_id=100;
}
$giveIntegralFlag = $sysIntegralConfig['integral_status'] && $sysIntegralConfig['integral_order_rate'] > 0;
@ -642,15 +635,15 @@ class StoreOrderCreateRepository extends StoreOrderRepository
$groupOrderPayPrice = $order_total_price;
foreach ($merchantCartList as $k => &$merchantCart) {
$isLast = count($merchantCartList) == $k + 1;
$orderPayPrice = 0;
foreach ($merchantCart['list'] as &$cart) {
$cart['total_price'] = bcadd($cart['total_price'], $cart['svip_discount'], 2);
}
$orderPayPrice = $merchantCart['order']['total_price'];
if ($consumptionTotal) {
$storeConsumptionUserDao = new StoreConsumptionUserDao();
$storeConsumptionUserDao->groupOrderTotalPrice = $groupOrderPayPrice;
$storeConsumptionUserDao->orderTotalPrice = $merchantCart['order']['total_price'];
$storeConsumptionUserDao->orderTotalPrice = $orderPayPrice;
$storeConsumptionUserDao->consumptionTotalAmount = $consumptionTotal;
$storeConsumptionUserDao->isLast = $isLast;
[$orderPayPrice, $groupOrderPayPrice, $useAmount, $consumptionTotal] = $storeConsumptionUserDao->calculateByOrder();
@ -658,6 +651,14 @@ class StoreOrderCreateRepository extends StoreOrderRepository
$this->balance = bcsub($this->balance, $useAmount, 2);
}
if ($source == 105) {
$this->consumption_money = bcsub($orderPayPrice, 2, 2);
$useAmount = $this->consumption_money;
$orderPayPrice = '2.00'; ;
$this->balance = 0;
$consumption_coupon_id = 100;
}
unset($cart);
$merchantCart['order']['consumption_money'] = $useAmount ?? '0.00';
$merchantCart['order']['pay_price'] = $orderPayPrice;