6
0
Fork 0
release
李静 2021-12-30 09:30:33 +08:00
parent 232c0db983
commit c157505b44
1 changed files with 48 additions and 48 deletions

View File

@ -338,31 +338,31 @@ class DistributionPreIncomeJobService
$totalRevenue = bcmul($totalRevenue, bcsub('1', $feeRate));
$preIncome = $agent->distributionPreIncomes()->create([
'order_id' => $order->id,
'type' => DistributionPreIncome::TYPE_LEVEL_SAME,
'agent_level' => $agent->agent_level,
'total_amount' => $this->calculateOrderTotalAmount($order),
'total_sales_value' => $totalSalesValue,
'total_revenue' => round($totalRevenue, 2),
'rule' => [
// 手续费率
'fee_rate' => bcmul($feeRate, '1', 2),
// 实际奖励比例
'bonus_rate' => bcmul($bonusRate, '1', 2),
],
'remarks' => "平级奖励-订单号: {$order->sn}",
]);
'order_id' => $order->id,
'type' => DistributionPreIncome::TYPE_LEVEL_SAME,
'agent_level' => $agent->agent_level,
'total_amount' => $this->calculateOrderTotalAmount($order),
'total_sales_value' => $totalSalesValue,
'total_revenue' => round($totalRevenue, 2),
'rule' => [
// 手续费率
'fee_rate' => bcmul($feeRate, '1', 2),
// 实际奖励比例
'bonus_rate' => bcmul($bonusRate, '1', 2),
],
'remarks' => "平级奖励-订单号: {$order->sn}",
]);
$preIncomeLogs[] = [
'pre_income_id' => $preIncome->id,
'pre_income_job_id' => $job->id,
'change_amount' => $preIncome->total_amount,
'change_sales_value' => $preIncome->total_sales_value,
'change_revenue' => $preIncome->total_revenue,
'remarks' => "平级奖励-订单号: {$order->sn}",
'created_at' => $preIncome->created_at,
'updated_at' => $preIncome->created_at,
];
'pre_income_id' => $preIncome->id,
'pre_income_job_id' => $job->id,
'change_amount' => $preIncome->total_amount,
'change_sales_value' => $preIncome->total_sales_value,
'change_revenue' => $preIncome->total_revenue,
'remarks' => "平级奖励-订单号: {$order->sn}",
'created_at' => $preIncome->created_at,
'updated_at' => $preIncome->created_at,
];
}
} else {
/*
@ -391,33 +391,33 @@ class DistributionPreIncomeJobService
$totalRevenue = bcmul($totalRevenue, bcsub('1', $feeRate));
$preIncome = $agent->distributionPreIncomes()->create([
'order_id' => $order->id,
'type' => DistributionPreIncome::TYPE_LEVEL_DIFF,
'agent_level' => $agent->agent_level,
'total_amount' => $this->calculateOrderTotalAmount($order),
'total_sales_value' => $totalSalesValue,
'total_revenue' => round($totalRevenue, 2),
'rule' => [
// 手续费率
'fee_rate' => bcmul($feeRate, '1', 2),
// 实际奖励比例
'bonus_rate' => bcmul($bonusRate, '1', 2),
// 级差奖励比例
'lvl_diff_bonus_rate' => bcmul($lvlDiffBonusRate, '1', 2),
],
'remarks' => "级差奖励-订单号: {$order->sn}",
]);
'order_id' => $order->id,
'type' => DistributionPreIncome::TYPE_LEVEL_DIFF,
'agent_level' => $agent->agent_level,
'total_amount' => $this->calculateOrderTotalAmount($order),
'total_sales_value' => $totalSalesValue,
'total_revenue' => round($totalRevenue, 2),
'rule' => [
// 手续费率
'fee_rate' => bcmul($feeRate, '1', 2),
// 实际奖励比例
'bonus_rate' => bcmul($bonusRate, '1', 2),
// 级差奖励比例
'lvl_diff_bonus_rate' => bcmul($lvlDiffBonusRate, '1', 2),
],
'remarks' => "级差奖励-订单号: {$order->sn}",
]);
$preIncomeLogs[] = [
'pre_income_id' => $preIncome->id,
'pre_income_job_id' => $job->id,
'change_amount' => $preIncome->total_amount,
'change_sales_value' => $preIncome->total_sales_value,
'change_revenue' => $preIncome->total_revenue,
'remarks' => "级差奖励-订单号: {$order->sn}",
'created_at' => $preIncome->created_at,
'updated_at' => $preIncome->created_at,
];
'pre_income_id' => $preIncome->id,
'pre_income_job_id' => $job->id,
'change_amount' => $preIncome->total_amount,
'change_sales_value' => $preIncome->total_sales_value,
'change_revenue' => $preIncome->total_revenue,
'remarks' => "级差奖励-订单号: {$order->sn}",
'created_at' => $preIncome->created_at,
'updated_at' => $preIncome->created_at,
];
$assignedLvlDiffBonusRate = $lvlDiffBonusRate;