0.01 元调试提现放行小额 + 已邀请好友数改按已比价口径

create_withdraw 加 allow_sub_min:仅 endpoint 在 skip_review 且非 prod(debug包+非生产双闸)时放行低于最低额的小额,生产恒按最低额校验。邀请 get_stats 的已邀请好友数改为只数 compare_reward_granted=True(完成比价、已发奖励)的好友,使人数×2元=累计提现+可提现余额恒等式成立,不再出现已邀请1、可提现0。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
no_gen_mu
2026-06-30 17:23:12 +08:00
parent afd92289f2
commit aadade72de
3 changed files with 19 additions and 2 deletions
+3
View File
@@ -202,6 +202,9 @@ def withdraw(req: WithdrawRequest, user: CurrentUser, db: DbSession) -> Withdraw
order = crud_wallet.create_withdraw(
db, user.id, req.amount_cents, source=req.source,
user_name=req.user_name, out_bill_no=req.out_bill_no,
# 0.01 元调试提现:放行低于最低额的小额。双闸——客户端仅 debug 包在「0.01 元提现」开关开时
# 连同 skip_review 一起下发;服务端仅非 prod 才认。生产恒 False,最低额校验照常。
allow_sub_min=(req.skip_review and not settings.is_prod),
)
except crud_wallet.InvalidWithdrawAmountError as e:
raise HTTPException(