diff --git a/app/Console/Commands/Dealer/OrderProcessCommand.php b/app/Console/Commands/Dealer/OrderProcessCommand.php index af2d31bb..56e37248 100644 --- a/app/Console/Commands/Dealer/OrderProcessCommand.php +++ b/app/Console/Commands/Dealer/OrderProcessCommand.php @@ -189,14 +189,14 @@ class OrderProcessCommand extends Command 'remark' => "补贴总额={$dealerOrder->total_amount}/{$upgradeAmount}*{$subsidyAmount}", ]); - $fee = bcmul($totalAmount, bcdiv($feeRate, '100', 5), 3); + $fee = bcmul($channelSubsidyLog->total_amount, bcdiv($feeRate, '100', 5), 3); $fee = round($fee, 2); $channelSubsidyLog->earning()->create([ - 'user_id' => $dealer->user_id, - 'lvl' => $dealer->lvl, - 'total_amount' => $totalAmount, - 'total_earnings' => bcsub($totalAmount, $fee, 2), + 'user_id' => $channelSubsidyLog->user_id, + 'lvl' => $channelSubsidyLog->lvl, + 'total_amount' => $channelSubsidyLog->total_amount, + 'total_earnings' => bcsub($channelSubsidyLog->total_amount, $fee, 2), 'fee' => $fee, 'fee_rate' => $feeRate, 'payer_id' => $dealerOrder->consignor_id,