feat(fulfillment): 支持手动同步斗鱼外部单协作
This commit is contained in:
@@ -17,6 +17,7 @@ from sqlalchemy.orm import Session
|
||||
from ...models import (
|
||||
Account,
|
||||
AccountLease,
|
||||
DouyuExternalOrder,
|
||||
DouyuGoodsSnapshot,
|
||||
DouyuTask,
|
||||
PlatformCommodityMapping,
|
||||
@@ -949,6 +950,11 @@ def _task_out(
|
||||
if task.bind_task_id
|
||||
else None
|
||||
)
|
||||
collab_order = (
|
||||
db.query(DouyuExternalOrder)
|
||||
.filter(DouyuExternalOrder.source_task_id == task.id)
|
||||
.first()
|
||||
)
|
||||
bind_result = (bind_task.result or {}) if bind_task else {}
|
||||
# 外层只消费共享绑定规则,不再自己比较角色名或 bindAct。
|
||||
pending_role = pending_binding_role_from_result(bind_result)
|
||||
@@ -982,6 +988,16 @@ def _task_out(
|
||||
"paidAt": task.paid_at,
|
||||
"createdAt": task.created_at,
|
||||
"updatedAt": task.updated_at,
|
||||
"collabOrder": (
|
||||
{
|
||||
"id": collab_order.id,
|
||||
"orderNo": collab_order.order_no,
|
||||
"status": collab_order.status,
|
||||
"lastSyncedAt": collab_order.last_synced_at,
|
||||
}
|
||||
if collab_order
|
||||
else None
|
||||
),
|
||||
"account": (
|
||||
{
|
||||
"id": account.id,
|
||||
|
||||
Reference in New Issue
Block a user