diff --git a/app/Services/DistributionPreIncomeJobService.php b/app/Services/DistributionPreIncomeJobService.php index 608f6b14..d6ffcf31 100644 --- a/app/Services/DistributionPreIncomeJobService.php +++ b/app/Services/DistributionPreIncomeJobService.php @@ -145,7 +145,16 @@ class DistributionPreIncomeJobService 'updated_at' => $time, ]; } elseif (in_array($preIncome->type, [DistributionPreIncome::TYPE_LEVEL_DIFF, DistributionPreIncome::TYPE_LEVEL_SAME])) { - $changeAmount = bcdiv($afterSale->amount, '100'); + if (bccomp($afterSale->sales_value, '0', 2) <= 0) { + continue; + } + + $changeAmount = $afterSale->amount; + if ($changeAmount > $afterSaleProduct->total_amount) { + $changeAmount = $afterSaleProduct->total_amount; + } + $changeAmount = bcdiv($changeAmount, '100'); + $changeSalesValue = $afterSale->sales_value; // 级差奖励和平级奖励按变更的销售值算收益 $changeRevenue = bcmul($changeSalesValue, $rule['bonus_rate']);