fix(fulfillment): 按支付时间过滤履约订单

This commit is contained in:
yml
2026-11-18 14:44:19 +08:00
parent 96fa9c7086
commit b7b09c90bd
9 changed files with 193 additions and 26 deletions
@@ -57,11 +57,10 @@ def run_auto_allocation_once(
PlatformFulfillmentTask.commodity_id != "",
PlatformFulfillmentTask.updated_at <= moment - timedelta(seconds=retry_seconds),
)
match_started_at = service._order_match_started_at(db)
if match_started_at is not None:
query = query.filter(
PlatformFulfillmentTask.created_at >= match_started_at,
)
query = service._apply_order_match_cutoff(
query,
service._order_match_started_at(db),
)
candidates = (
query.order_by(PlatformFulfillmentTask.updated_at.asc()).limit(batch_size).all()
)