fix(invitation): 邀请返利改用实际结算利润并修正提号基准

This commit is contained in:
yml2213
2026-10-29 11:49:08 +08:00
parent e57c9df6f4
commit 86fbc05e9b
7 changed files with 277 additions and 13 deletions
@@ -135,6 +135,11 @@ func (r *Repository) Arbitrate(ctx context.Context, adminID uint64, id uint64, r
if err := tx.Save(&order).Error; err != nil {
return err
}
if order.DistributionSiteID != nil && *order.DistributionSiteID > 0 {
if err := distribution.ApplyRefundTx(tx, order.ID, refundAmountCent); err != nil {
return err
}
}
if order.Status == "completed" {
if actualSettlement == nil {
return ErrInvalidDispute
@@ -153,11 +158,6 @@ func (r *Repository) Arbitrate(ctx context.Context, adminID uint64, id uint64, r
)
}
}
if order.DistributionSiteID != nil && *order.DistributionSiteID > 0 {
if err := distribution.ApplyRefundTx(tx, order.ID, refundAmountCent); err != nil {
return err
}
}
if err := tx.Save(&listing).Error; err != nil {
return err
}