From 4a2594a90ce16de13cf6e57b740c8133a1c85886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sun, 4 Oct 2026 10:35:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3(=E4=BC=9A=E5=91=98=E6=94=AF?= =?UTF-8?q?=E4=BB=98)=EF=BC=9A=E5=BE=AE=E4=BF=A1=E8=99=9A=E6=8B=9F?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=8F=AA=E6=8E=A5=E5=8F=97=E5=9C=A8=E5=94=AE?= =?UTF-8?q?=E4=B8=94=E5=8F=AF=E8=B4=AD=E4=B9=B0=E7=9A=84=E6=A1=A3=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - build_wechat_virtual_pay_params 的档位校验补齐 enabled 与 is_purchasable - 与 resolve_enabled_profile_recharge_order_product 的可售判定对齐,拒绝 Normal 占位与下架档位 --- server-rs/crates/api-server/src/runtime_profile.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server-rs/crates/api-server/src/runtime_profile.rs b/server-rs/crates/api-server/src/runtime_profile.rs index fbdd8bdc2..ae0bfdb73 100644 --- a/server-rs/crates/api-server/src/runtime_profile.rs +++ b/server-rs/crates/api-server/src/runtime_profile.rs @@ -1821,14 +1821,18 @@ fn build_wechat_virtual_pay_params( .with_message("当前充值商品不存在,请刷新后再试") })?, RuntimeProfileRechargeProductKind::Membership => { - // 会员商品不在商品配置表里:确认档位仍在目录中即可,购买数量固定为 1。 + // 会员商品不在商品配置表里:确认档位仍可售(在售且非 Normal 占位)即可,购买数量固定为 1。 let (plan, _) = module_runtime::parse_runtime_profile_membership_product_id(&order.product_id) .ok_or_else(|| { AppError::from_status(StatusCode::BAD_REQUEST) .with_message("当前会员套餐不存在,请刷新后再试") })?; - if !center.membership_plans.iter().any(|item| item.plan == plan) { + if !center + .membership_plans + .iter() + .any(|item| item.plan == plan && item.enabled && item.plan.is_purchasable()) + { return Err(AppError::from_status(StatusCode::BAD_REQUEST) .with_message("当前会员套餐不存在,请刷新后再试")); }