修复(履约绑定): 收敛活动别名中的瞬时历史角色

This commit is contained in:
yml
2026-11-26 01:03:22 +08:00
parent 4198f7ab39
commit 204cbd5d82
10 changed files with 574 additions and 47 deletions
@@ -10,6 +10,7 @@ from sqlalchemy.orm import Session
from ...models import (
AccountLease,
DouyuTask,
PlatformFulfillmentTask,
)
from .binding import (
@@ -99,6 +100,15 @@ def save_customer_profile(
task.customer_home_images = images
task.customer_profile_updated_at = datetime.now(UTC)
task.updated_at = datetime.now(UTC)
if task.bind_task_id and task.customer_role_name:
bind_task = db.get(DouyuTask, int(task.bind_task_id))
if bind_task is not None and bind_task.task_type in {
"get_bind_qr",
"confirm_bind",
}:
result = dict(bind_task.result or {})
result["expected_role_name"] = task.customer_role_name
bind_task.result = result
_append_event(
db,
task.id,