fix: 打手提现/收款认赠送会员为有效会员资格
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -27,6 +27,17 @@ def _gift_record_active(record, now=None):
|
|||||||
return daoqi > now
|
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):
|
def parse_gift_daoqi_time(raw):
|
||||||
"""
|
"""
|
||||||
解析到期时间。
|
解析到期时间。
|
||||||
|
|||||||
@@ -240,16 +240,19 @@ def check_dashou_has_valid_huiyuan(yonghuid):
|
|||||||
|
|
||||||
def check_dashou_has_formal_huiyuan_for_withdraw(yonghuid):
|
def check_dashou_has_formal_huiyuan_for_withdraw(yonghuid):
|
||||||
"""
|
"""
|
||||||
打手佣金提现/收款:必须持有未过期的正式会员。
|
打手佣金提现/收款:须持有未过期的正式会员,或后台赠送会员。
|
||||||
体验会员期内一律拒绝;体验到期后须购买正式会员。
|
体验会员期内一律拒绝;体验到期后须购买正式会员或持有赠送会员。
|
||||||
"""
|
"""
|
||||||
from jituan.services.member_recharge import (
|
from jituan.services.member_recharge import (
|
||||||
dashou_has_active_formal_huiyuan,
|
dashou_has_active_formal_huiyuan,
|
||||||
dashou_in_active_trial_period,
|
dashou_in_active_trial_period,
|
||||||
)
|
)
|
||||||
|
from jituan.services.gift_huiyuan import user_has_any_active_gift_huiyuan
|
||||||
|
|
||||||
if dashou_has_active_formal_huiyuan(yonghuid):
|
if dashou_has_active_formal_huiyuan(yonghuid):
|
||||||
return True, ''
|
return True, ''
|
||||||
|
if user_has_any_active_gift_huiyuan(yonghuid):
|
||||||
|
return True, ''
|
||||||
if dashou_in_active_trial_period(yonghuid):
|
if dashou_in_active_trial_period(yonghuid):
|
||||||
return False, '体验会员不可提现佣金,请购买正式会员'
|
return False, '体验会员不可提现佣金,请购买正式会员'
|
||||||
if not Huiyuangoumai.query.filter(yonghu_id=yonghuid).exists():
|
if not Huiyuangoumai.query.filter(yonghu_id=yonghuid).exists():
|
||||||
|
|||||||
Reference in New Issue
Block a user