fix(distribution): 修复收号站订单详情权限、专属支付通道路由、大盘统计与仲裁积分隔离
- 修复 FindOrder 在收号站模式(two_party_distributor_receive / three_party)下的 403 权限判定,放行参与方站点成员并精准计算收益 - 串联 distribution_site_payment_channels 至 payment.Start 核心支付发起流程,分销订单优先使用绑定的专属商户通道 - 修复数据大盘 GetDashboardAnalytics 趋势中 ReceivedCount 恒为 0 的问题,并对齐今日订单与 GMV 统计 - 修复 dispute/arbitration.go 仲裁完成时向分销租客发放成长积分的泄漏风险 - 提现管理新增 distribution_site_name/distribution_site_code 字段并在后台列表与详情弹窗中区分展示分销站 - GetPublicSiteInfo 增加 X-Distribution-Site-Code 请求头兜底支持
This commit is contained in:
@@ -124,8 +124,10 @@ func (r *Repository) Arbitrate(ctx context.Context, adminID uint64, id uint64, r
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := rentergrowth.AwardOrderCompleted(tx, &order, actualSettlement.PureCoinAmountCent, rentergrowth.SourceOrderCompleted); err != nil {
|
||||
return err
|
||||
if order.DistributionSiteID == nil || *order.DistributionSiteID == 0 {
|
||||
if err := rentergrowth.AwardOrderCompleted(tx, &order, actualSettlement.PureCoinAmountCent, rentergrowth.SourceOrderCompleted); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
if err := tx.Save(&order).Error; err != nil {
|
||||
|
||||
@@ -141,4 +141,10 @@ func TestArbitrationDistributionRefundUsesActualRefundWithDepositHold(t *testing
|
||||
t.Fatalf("分销快照 net_paid_amount_cent = %d, want %d(毛收入 %d − 实际租金退款 %d)",
|
||||
snapshot.NetPaidAmountCent, wantNetPaid, order.RentAmountCent, wantRentRefundCent)
|
||||
}
|
||||
|
||||
var growthLogsCount int64
|
||||
db.Model(&model.RenterGrowthLedger{}).Where("order_id = ?", order.ID).Count(&growthLogsCount)
|
||||
if growthLogsCount != 0 {
|
||||
t.Fatalf("分销订单仲裁不应发放用户成长积分,但产生了 %d 条记录", growthLogsCount)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user