6
0
Fork 0

修复奖金分润

release
李静 2022-01-06 12:01:30 +08:00
parent b2cd493af4
commit f376f58fe2
3 changed files with 28 additions and 26 deletions

View File

@ -42,6 +42,7 @@ class AfterSale extends Model
'images',
'remarks',
'tracking_number',
'sales_value',
];
public static $stateText = [

View File

@ -87,6 +87,7 @@ class Order extends Model
'auto_complete_at',
'is_change',
'is_settle',
'sales_value',
];
public static $payWayText = [

View File

@ -315,8 +315,6 @@ class DistributionPreIncomeJobService
$assignedLvlDiffBonusRate = 0;
foreach ($agents as $agent) {
// 如果当前代理可以享受奖励
if ($agent->bonusable) {
$rule = Arr::get($config, "rules.{$agent->agent_level_key}");
if ($lastAgent && $agent->agent_level === $lastAgent->agent_level) {
@ -326,6 +324,7 @@ class DistributionPreIncomeJobService
|-----------------------------------------------
*/
if ($agent->bonusable) {
$bonusRate = $rule['lvl_same_bonus_rate'] ?? '0';
if (bccomp($bonusRate, '0') === 1) {
@ -364,6 +363,7 @@ class DistributionPreIncomeJobService
'updated_at' => $preIncome->created_at,
];
}
}
} else {
/*
|-----------------------------------------------
@ -382,6 +382,7 @@ class DistributionPreIncomeJobService
break;
}
if ($agent->bonusable) {
// 手续费率
$feeRate = $config['lvl_diff_bonus_fee_rate'] ?? '0';
@ -418,12 +419,11 @@ class DistributionPreIncomeJobService
'created_at' => $preIncome->created_at,
'updated_at' => $preIncome->created_at,
];
}
$assignedLvlDiffBonusRate = $lvlDiffBonusRate;
}
}
}
$lastAgent = $agent;
}