v0.10.23: 落地页收口(toggle/内嵌模板 27143/posts cards/info-box)+ dev 3311 修复
This commit is contained in:
@@ -29,12 +29,12 @@ const elements = await extractTemplate(1398);
|
||||
const meta = JSON.stringify({ elementor: elements });
|
||||
const existing = await db`SELECT id FROM contents WHERE slug='shop-archive' AND type='template'`;
|
||||
if (existing.length) {
|
||||
await db`UPDATE contents SET meta=${meta}::jsonb, status='published', updated_at=now() WHERE id=${existing[0]!.id}`;
|
||||
await db`UPDATE contents SET meta=${meta}::text::jsonb, status='published', updated_at=now() WHERE id=${existing[0]!.id}`;
|
||||
console.log("已更新 shop-archive 模板,contents.id =", existing[0]!.id);
|
||||
} else {
|
||||
const inserted = await db`
|
||||
INSERT INTO contents (type, slug, title, status, meta, legacy_id, published_at)
|
||||
VALUES ('template', 'shop-archive', 'Shop Archive', 'published', ${meta}::jsonb, 1398, now())
|
||||
VALUES ('template', 'shop-archive', 'Shop Archive', 'published', ${meta}::text::jsonb, 1398, now())
|
||||
RETURNING id`;
|
||||
console.log("已插入 shop-archive 模板,contents.id =", inserted[0]!.id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user