fix(01-04): 修正场景5代理代购下级的sellerCostPrice赋值

- 三处代理代购下级分支(wallet场景子场景2.2)均将 sellerCostPrice = buyerCostPrice 改为 sellerCostPrice = operatorCostPrice
- buyerCostPrice 是下级成本价,operatorCostPrice 是操作方(代理自己)的成本价
- 使用 buyerCostPrice 会导致佣金差额为 0,所有上级代理无法获得应有佣金
- 修复涉及三个函数(普通下单/后台下单/H5下单),行号分别约在 264/551/813
This commit is contained in:
2026-03-27 23:24:16 +08:00
parent 6de830fcc4
commit f74b7da25f

View File

@@ -259,7 +259,9 @@ func (s *Service) CreateLegacy(ctx context.Context, req *dto.CreateOrderRequest,
operatorType = "agent"
actualPaidAmount = &operatorCostPrice
purchaseRole = model.PurchaseRolePurchaseForSubordinate
sellerCostPrice = buyerCostPrice
// 代理代购下级时,佣金差额基准应是操作方(代理自己)的成本价,而非下级的成本价
// 使用 buyerCostPrice 会导致差额为 0上级代理无法获得应有佣金
sellerCostPrice = operatorCostPrice
}
}
@@ -545,7 +547,8 @@ func (s *Service) CreateAdminOrder(ctx context.Context, req *dto.CreateAdminOrde
operatorType = "agent"
actualPaidAmount = &operatorCostPrice
purchaseRole = model.PurchaseRolePurchaseForSubordinate
sellerCostPrice = buyerCostPrice
// 代理代购下级时,佣金差额基准应是操作方(代理自己)的成本价,而非下级的成本价
sellerCostPrice = operatorCostPrice
}
} else {
// 兜底检查后台不支持其他支付方式DTO 验证已拒绝,此为防御性编程)
@@ -806,7 +809,8 @@ func (s *Service) CreateH5Order(ctx context.Context, req *dto.CreateOrderRequest
operatorType = "agent"
actualPaidAmount = &operatorCostPrice
purchaseRole = model.PurchaseRolePurchaseForSubordinate
sellerCostPrice = buyerCostPrice
// 代理代购下级时,佣金差额基准应是操作方(代理自己)的成本价,而非下级的成本价
sellerCostPrice = operatorCostPrice
}
}