From 0fc564c4e51964c193de82cf8dbf031bbb732581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 3 Oct 2026 19:42:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BC=9A=E5=91=98=E7=BB=93=E7=AE=97):=20?= =?UTF-8?q?=E6=8B=92=E7=BB=9D=E8=BF=87=E6=9C=9F=E6=96=B0=E8=B4=AD=E5=8D=95?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E6=9B=B4=E6=96=B0=E7=9A=84=E4=BC=9A=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 冻结的新购单下单时用户无有效会员,若支付前已通过其他订单获得有效会员,结算会按 user_id 删除重插,覆盖更新 / 更长的会员。 - 在 apply_profile_membership_purchase 中当 change_kind 为 Purchase 且 active_row 存在时返回「会员状态已变化,请重新下单」,与升级分支守卫一致。 - 历史无快照的重算路径只会在 active_row 为空时产出 Purchase,不受影响。 --- .../spacetime-module/src/runtime/active/profile.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server-rs/crates/spacetime-module/src/runtime/active/profile.rs b/server-rs/crates/spacetime-module/src/runtime/active/profile.rs index 40d91ceaf..5510948c4 100644 --- a/server-rs/crates/spacetime-module/src/runtime/active/profile.rs +++ b/server-rs/crates/spacetime-module/src/runtime/active/profile.rs @@ -9968,6 +9968,15 @@ fn apply_profile_membership_purchase( )?, }; + // 中文注释:冻结的新购单在下单时用户无有效会员;若支付前用户已通过其他订单获得有效会员, + // 继续走新购会按 user_id 删除重插,覆盖掉更新 / 更长的会员(降档或丢失已付时长), + // 因此拒绝并要求重新下单。历史重算路径只会在 active_row 为空时产出 Purchase,不受影响。 + if settlement.change_kind == RuntimeProfileMembershipChangeKind::Purchase + && active_row.is_some() + { + return Err("会员状态已变化,请重新下单".to_string()); + } + if settlement.change_kind == RuntimeProfileMembershipChangeKind::Upgrade { if let Some(row) = active_row { // 中文注释:结算前比对订单冻结的变更前状态。若用户已先付了更高档位的升级单、