修复取消订单误释放商品

This commit is contained in:
yml2213
2026-08-02 16:38:02 +08:00
parent 921654e5b0
commit 0256bfd276
5 changed files with 237 additions and 2 deletions
@@ -447,6 +447,13 @@ func (r *Repository) AdminRejectRefund(ctx context.Context, orderID uint64, acti
if order.Status != orderStatusCancelled {
return errors.New("仅已取消的订单可以恢复")
}
active, err := hasActiveSiblingOrder(tx, order)
if err != nil {
return err
}
if active {
return ErrListingUnavailable
}
order.Status = orderStatusPendingHandoff
if order.HandoffStatus == handoffStatusCancelled || order.HandoffStatus == handoffStatusRenterConfirmTimeout {
order.HandoffStatus = handoffStatusPendingOwner