fix: dddhq与dashouxinxi每次请求同步刷新会员clumber
抢单池拉单前先 sync 权益;老端依赖 yaoqiuleixing=0 与 clumber 即时更新。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -186,6 +186,9 @@ def resolve_order_membership_ids(order_dict):
|
||||
)
|
||||
if mid:
|
||||
ids.append(mid)
|
||||
grab_req = int(order_dict.get('GrabRequirement') or order_dict.get('yaoqiuleixing') or 0)
|
||||
if grab_req != 1:
|
||||
return ids
|
||||
leixing_id = order_dict.get('ProductTypeID') or order_dict.get('leixing_id')
|
||||
if leixing_id:
|
||||
try:
|
||||
@@ -357,12 +360,12 @@ def _build_clumber_from_paid_czjilu(yonghu_id):
|
||||
|
||||
def ensure_grab_pool_clumber(yonghu_id, club_id=None):
|
||||
"""
|
||||
【仅抢单池 dddhq 展示】体验会员与正式会员同格式写入 clumber。
|
||||
不得用于提现;提现须 check_dashou_has_formal_huiyuan_for_withdraw。
|
||||
【ddhq / dashouxinxi 展示专用】每次请求:先同步已付会员权益,再生成 clumber(体验=正式)。
|
||||
提现校验不得使用此函数。
|
||||
"""
|
||||
from jituan.services.member_recharge import sync_member_entitlements_for_user
|
||||
|
||||
sync_member_entitlements_for_user(yonghu_id)
|
||||
sync_member_entitlements_for_user(yonghu_id, limit=30)
|
||||
items = _build_user_clumber_core(yonghu_id)
|
||||
extra = _build_clumber_from_paid_czjilu(yonghu_id)
|
||||
if extra:
|
||||
@@ -382,6 +385,14 @@ def ensure_grab_pool_clumber(yonghu_id, club_id=None):
|
||||
return bool(items), items
|
||||
|
||||
|
||||
def refresh_grab_pool_membership_state(yonghu_id, club_id=None):
|
||||
"""
|
||||
抢单池/打手资料:请求入口统一刷新会员状态(同步权益 + clumber)。
|
||||
供 /dingdan/ddhq、/yonghu/dashouxinxi、登录 clumber 调用。
|
||||
"""
|
||||
return ensure_grab_pool_clumber(yonghu_id, club_id=club_id)
|
||||
|
||||
|
||||
def build_user_clumber(yonghu_id, club_id=None):
|
||||
"""
|
||||
老小程序抢单页 clumber(体验=正式格式)。
|
||||
@@ -392,9 +403,8 @@ def build_user_clumber(yonghu_id, club_id=None):
|
||||
|
||||
|
||||
def build_auth_clumber(yonghu_id, club_id=None):
|
||||
"""登录/刷新 clumber:与 dddhq 同源(含体验会员 czjilu 兜底),老端只认 huiyuanid。"""
|
||||
_, items = ensure_grab_pool_clumber(yonghu_id, club_id=club_id)
|
||||
return items
|
||||
"""登录 clumber:与 dddhq / dashouxinxi 同源,每次刷新会员状态。"""
|
||||
return refresh_grab_pool_membership_state(yonghu_id, club_id=club_id)[1]
|
||||
|
||||
|
||||
def save_bundle_includes(club_id, bundle_huiyuan_id, included_ids):
|
||||
|
||||
Reference in New Issue
Block a user