From 3031f588757e2dba4661e4bfa84c0bee48fbb18a 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 16:16:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E5=8D=87=E7=BA=A7=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E5=89=8D=E6=A0=A1=E9=AA=8C=E8=AE=A2=E5=8D=95=E5=86=BB?= =?UTF-8?q?=E7=BB=93=E7=9A=84=E5=8F=98=E6=9B=B4=E5=89=8D=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结算补差升级单前比对 settlement.plan_before / cycle_kind_before 与当前会员行,不一致直接拒绝「会员状态已变化,请重新下单」 避免用户先付更高档位升级单后,旧升级单落地把档位 / 周期覆盖回去,出现降档或「年付 + 一个月到期」的矛盾行 api-server 把该业务拒绝映射为 400 --- server-rs/crates/api-server/src/runtime_profile.rs | 1 + .../crates/spacetime-module/src/runtime/active/profile.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/server-rs/crates/api-server/src/runtime_profile.rs b/server-rs/crates/api-server/src/runtime_profile.rs index 9d585f6c5..672c5da4f 100644 --- a/server-rs/crates/api-server/src/runtime_profile.rs +++ b/server-rs/crates/api-server/src/runtime_profile.rs @@ -1516,6 +1516,7 @@ fn is_runtime_profile_membership_domain_error(message: &str) -> bool { | "当前套餐已生效,无需重复购买" | "当前会员有效期内不支持月付 / 年付转换,到期后可重新选择" | "会员已到期,请按新购价格重新下单" + | "会员状态已变化,请重新下单" ) } 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 17811db29..737d1ff0c 100644 --- a/server-rs/crates/spacetime-module/src/runtime/active/profile.rs +++ b/server-rs/crates/spacetime-module/src/runtime/active/profile.rs @@ -9867,6 +9867,14 @@ fn apply_profile_membership_purchase( if settlement.change_kind == RuntimeProfileMembershipChangeKind::Upgrade { if let Some(row) = active_row { + // 中文注释:结算前比对订单冻结的变更前状态。若用户已先付了更高档位的升级单、 + // 或到期后按不同周期重新购买,旧升级单直接落库会把档位 / 周期覆盖回去, + // 只剩原到期日,产生降档或「年付 + 一个月到期」的矛盾行,因此拒绝并要求重新下单。 + if settlement.plan_before != Some(row.plan) + || settlement.cycle_kind_before != Some(row.cycle_kind) + { + return Err("会员状态已变化,请重新下单".to_string()); + } return apply_profile_membership_upgrade( ctx, user_id,