fix: 打手提现/收款认赠送会员为有效会员资格

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-19 21:34:57 +08:00
parent e7b59feacd
commit de74865278
2 changed files with 16 additions and 2 deletions

View File

@@ -27,6 +27,17 @@ def _gift_record_active(record, now=None):
return daoqi > now
def user_has_any_active_gift_huiyuan(yonghu_id):
"""是否持有任意一条未过期的赠送会员(提现/收款资格用)。"""
if not yonghu_id:
return False
now = timezone.now()
for rec in DashouZengsongHuiyuan.query.filter(yonghu_id=yonghu_id):
if _gift_record_active(rec, now=now):
return True
return False
def parse_gift_daoqi_time(raw):
"""
解析到期时间。