admin/sql/migrate_order_status_pending_allocation.sql
zzh 3d5eaa223a feat: 小包全链路加固、待排货与运单号 IDE 前缀
查价/下单/入库/出库统一校验与计费上下文;待排货状态及可选入库排货;运单号改为 IDE+yyMMddHHmmss;补充迁移 SQL 与测试修复。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-22 19:00:55 +08:00

13 lines
540 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.

-- 订单状态:待排货(入库排货/渠道买价未成功)
-- 可重复执行(INSERT IGNORE)
INSERT IGNORE INTO `t_dict` (`DictType`, `DictSort`, `DictCode`, `DictName`, `CreateUserId`)
VALUES ('order_status', 35, 'pendingAllocation', '待排货', 0);
-- 历史数据:有排货失败原因但状态仍为待支付的订单,修正为待排货
UPDATE `t_order`
SET `OrderStatus` = 'pendingAllocation',
`UpdateTime` = NOW()
WHERE TRIM(IFNULL(`AllocationPendingReason`, '')) <> ''
AND `OrderStatus` = 'pendingPayment';