12 lines
598 B
SQL
12 lines
598 B
SQL
|
|
-- Luxsin X8(product_id=1)区块排序修复
|
|||
|
|
-- 背景:所有区块 sort_order 均为 0,前台按 sort_order 排序导致顺序混乱。
|
|||
|
|
-- 已确认 www_section_blocks.id 为自增主键,按 id 升序(即创建顺序)重新分配 sort_order(0 起)。
|
|||
|
|
-- 同时后端 POST /api/www/sections 已改为:未指定 sort_order 时取同 page_type(+product_id)
|
|||
|
|
-- 下现有区块的 max(sort_order)+1 自动追加,不再默认 0。
|
|||
|
|
|
|||
|
|
SET @row := -1;
|
|||
|
|
UPDATE www_section_blocks
|
|||
|
|
SET sort_order = (@row := @row + 1)
|
|||
|
|
WHERE page_type = 'product_detail' AND product_id = 1
|
|||
|
|
ORDER BY id;
|