admin/sql/20260804_order_status_drop_received.sql
zzh b2355104cf feat: 完善揽收单与问题件处理能力
补齐揽收单字段/并发戳与问题件处理人配置,扩展异常工作流与下单同步揽收出参;移除已收货状态并补充相关 SQL 脚本。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 11:49:23 +08:00

15 lines
558 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 废弃订单状态 received(已收货):入库后直接进 pendingAllocation / pendingPayment,不再停留 received
-- 历史数据:已入库的归待排货;若已有应付且未支付则归待支付
UPDATE `t_order`
SET
`OrderStatus` = CASE
WHEN IFNULL(`IsPaid`, 0) > 0 THEN 'pendingShip'
WHEN IFNULL(`PayableAmount`, 0) > 0
AND (`AllocationPendingReason` IS NULL OR TRIM(`AllocationPendingReason`) = '')
THEN 'pendingPayment'
ELSE 'pendingAllocation'
END,
`UpdateTime` = NOW()
WHERE `OrderStatus` = 'received';