From f74b7da25fbb0555218ba2f732e28bc9d7dd52d4 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 27 Mar 2026 23:24:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(01-04):=20=E4=BF=AE=E6=AD=A3=E5=9C=BA?= =?UTF-8?q?=E6=99=AF5=E4=BB=A3=E7=90=86=E4=BB=A3=E8=B4=AD=E4=B8=8B?= =?UTF-8?q?=E7=BA=A7=E7=9A=84sellerCostPrice=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 三处代理代购下级分支(wallet场景子场景2.2)均将 sellerCostPrice = buyerCostPrice 改为 sellerCostPrice = operatorCostPrice - buyerCostPrice 是下级成本价,operatorCostPrice 是操作方(代理自己)的成本价 - 使用 buyerCostPrice 会导致佣金差额为 0,所有上级代理无法获得应有佣金 - 修复涉及三个函数(普通下单/后台下单/H5下单),行号分别约在 264/551/813 --- internal/service/order/service.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/service/order/service.go b/internal/service/order/service.go index bda54e3..02a3a7f 100644 --- a/internal/service/order/service.go +++ b/internal/service/order/service.go @@ -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 } }