feat(douyu): 落地账号平台同步与登录配额
This commit is contained in:
@@ -157,6 +157,24 @@ def is_high_value_expr(*, now: datetime | None = None):
|
||||
return value_tier_expr(now=now) <= HIGH_VALUE_TIER_MAX
|
||||
|
||||
|
||||
def is_high_value_account(
|
||||
account: Account,
|
||||
*,
|
||||
now: datetime | None = None,
|
||||
) -> bool:
|
||||
"""Python 侧价值判定,供登录分类和库存队列复用 SQL 口径。"""
|
||||
moment = now or datetime.now(UTC)
|
||||
fresh = bool(
|
||||
account.high_value_checked_at
|
||||
and account.high_value_checked_at >= high_value_fresh_cutoff(now=moment)
|
||||
)
|
||||
available = fresh and (
|
||||
account.high_value_bairimeng_status == HIGH_VALUE_STATUS_AVAILABLE
|
||||
or account.high_value_mengtu_status == HIGH_VALUE_STATUS_AVAILABLE
|
||||
)
|
||||
return available or int(account.points or 0) >= HIGH_VALUE_POINTS
|
||||
|
||||
|
||||
def suit_sort_rank_expr(*, now: datetime | None = None):
|
||||
"""列表「高价值套装」列的排序,和格子上看到的一致。数字越小越值钱。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user