fix(partner): 全网平级奖截断阈值修正为不能少于0.10元(1角钱)

这个提交包含在:
chen
2026-09-17 14:08:44 +08:00
父节点 5f9b407e64
当前提交 2ccd69b9e7
共有 4 个文件被更改,包括 122 次插入 和 110 次删除

查看文件

@@ -3,7 +3,7 @@
namespace addons\shopro\service\partner;
/**
* 酒道馆 / 区县平级 10% 逐代递减级联,最低发放 0.01 元截断
* 酒道馆 / 区县平级 10% 逐代递减级联,最低发放不能少于 0.10 元截断
*/
class PeerShareReward
{
@@ -22,6 +22,11 @@ class PeerShareReward
protected function peer($order, $buyerId, $chain, $from, $flag, $type, $role, $rate, ActiveService $active, $label)
{
$minAmount = (float) PartnerConfig::get('partner_peer_min_amount', 0.10);
if ($minAmount <= 0) {
$minAmount = 0.10;
}
$maxGenerations = intval(PartnerConfig::get("partner_{$role}_peer_max_generations", 50));
if ($maxGenerations <= 0) {
$maxGenerations = 50;
@@ -45,8 +50,8 @@ class PeerShareReward
$peer = $chain[$peerIdx];
$amount = round($currentBase * $rate, 2);
if ($amount < 0.01) {
break;
if ($amount < $minAmount) {
break; // 收益少于 0.10 元,上级平级不再拿,严格截断
}
if (!$active->isActive($peer['agent'] ?? $peer)) {
@@ -80,7 +85,7 @@ class PeerShareReward
$currentBase = $amount;
$sourceUserId = $peer['user_id'];
if ($currentBase < 0.01) {
if ($currentBase < $minAmount) {
break;
}
}