Files
hfb_sys/backend/migrations/000031_mohong_order_items.sql
yml2213 183351a297 摸大红支持购物车多选一起结账
下单支持多商品行快照与一次支付;支付后整单复制文案,前台提供购物车加购与结账。
2026-07-16 20:58:39 +08:00

16 lines
812 B
SQL
Raw Permalink 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.
-- +goose Up
-- 摸大红订单支持多商品:商品行快照(兼容旧单:无 items 时仍读 product_snapshot
ALTER TABLE mohong_orders
ADD COLUMN items_snapshot JSON NULL COMMENT '订单商品行快照[{product_id,title,quantity,unit_price_cent,...}]' AFTER product_snapshot;
UPDATE system_configs
SET `value` = '【摸大红订单】\n订单号:{{order_no}}\n下单时间:{{created_at}}\n商品明细:\n{{items}}\n数量合计:{{quantity}}\n金额:{{amount}}\n下单人:{{buyer_name}}{{buyer_phone}}',
description = '摸大红订单一键复制文案模板(支持多商品 {{items}}'
WHERE `key` = 'mohong.order_copy_template'
AND (`value` LIKE '%商品:{{product_title}}%' OR `value` = '');
-- +goose Down
ALTER TABLE mohong_orders DROP COLUMN items_snapshot;