From 52c6e4ca5de258e63a8c8dc636a1024f76e1a055 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Sat, 2 Mar 2024 16:48:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95=E8=B4=A2?= =?UTF-8?q?=E5=8A=A1=E6=B5=81=E6=B0=B4=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreOrderRepository.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index c20a6e59..90e7a0f5 100755 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -312,37 +312,37 @@ class StoreOrderRepository extends BaseRepository $financeDao->platformOut($order->consumption_money, 'platform_consumption'); } - $_payPrice = bcsub($order->total_price, bcadd($order['extension_one'], $order['extension_two'], 3), 2); - $_payPrice = bcsub($_payPrice, $order->consumption_money, 2); + $_payPrice = bcsub($order->pay_price, bcadd($order['extension_one'], $order['extension_two'], 3), 2); + $orderValidAmount = bcsub($order->total_price, bcadd($order['extension_one'], $order['extension_two'], 3), 2); // 平台支出推广费 $promoter = $order->merchant->promoter(); - $promoterCommission = bcmul($_payPrice, 0.003, 2); + $promoterCommission = bcmul($orderValidAmount, 0.003, 2); if (!empty($promoter) && $promoterCommission > 0) { $financeDao->platformOut($promoterCommission, 'commission_to_promoter'); } // 平台收入手续费 $commission_rate = bcdiv((string)$order['commission_rate'],'100',6); - $platformCommission = bcmul($_payPrice, (string)$commission_rate, 2); + $platformCommission = bcmul($orderValidAmount, (string)$commission_rate, 2); if ($commission_rate > 0 && $platformCommission > 0) { - $_payPrice = bcsub($_payPrice, $platformCommission, 2); + $orderValidAmount = bcsub($orderValidAmount, $platformCommission, 2); if ($promoterCommission > 0) { $platformCommission = bcsub($platformCommission, $promoterCommission, 2); } $financeDao->platformIn($platformCommission, 'commission_to_platform', $order['mer_id']); } - if ($_payPrice > 0) { + if ($orderValidAmount > 0) { /** @var MerchantRepository $merchantRepo */ $merchantRepo = app()->make(MerchantRepository::class); $merchantRepo->merId = $order['mer_id']; $merchantRepo->forceMargin = false; - [$_payPrice, $financeDao] = $merchantRepo->deductDeposit($_payPrice, $order, $financeDao); + [$orderValidAmount, $financeDao] = $merchantRepo->deductDeposit($orderValidAmount, $order, $financeDao); } // 商户收入金额 - $financeDao->platformOut($_payPrice, 'merchant_order', $order['mer_id']); + $financeDao->platformOut($orderValidAmount, 'merchant_order', $order['mer_id']); if ($is_combine) { $profitsharing[] = [