v0.10.23: 落地页收口(toggle/内嵌模板 27143/posts cards/info-box)+ dev 3311 修复
This commit is contained in:
@@ -108,12 +108,12 @@ const meta = JSON.stringify({ elementor: elements });
|
||||
// 写入 contents:type=template / slug=footer;已存在则更新
|
||||
const existing = await db`SELECT id FROM contents WHERE slug='footer' 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("已更新 footer 模板,contents.id =", existing[0]!.id);
|
||||
} else {
|
||||
const inserted = await db`
|
||||
INSERT INTO contents (type, slug, title, status, meta, legacy_id, published_at)
|
||||
VALUES ('template', 'footer', 'Footer', 'published', ${meta}::jsonb, 58, now())
|
||||
VALUES ('template', 'footer', 'Footer', 'published', ${meta}::text::jsonb, 58, now())
|
||||
RETURNING id`;
|
||||
console.log("已插入 footer 模板,contents.id =", inserted[0]!.id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user