Update README and project cleanup
This commit is contained in:
39
scripts/fix-category-order.js
Normal file
39
scripts/fix-category-order.js
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const Database = require('better-sqlite3');
|
||||
const path = require('path');
|
||||
|
||||
const dbPath = path.join(__dirname, '../dmp_onion.db');
|
||||
const db = new Database(dbPath);
|
||||
|
||||
console.log('修复分类顺序...\n');
|
||||
|
||||
// 重新设置所有sort_order
|
||||
const updates = [
|
||||
{ id: 46, sort: 0, name: '家庭角色' },
|
||||
{ id: 34, sort: 1, name: '用户年龄段标签' },
|
||||
{ id: 35, sort: 2, name: '孩子学段标签' },
|
||||
{ id: 36, sort: 3, name: '家庭结构标签' },
|
||||
{ id: 37, sort: 4, name: '教育风险标签' },
|
||||
{ id: 38, sort: 5, name: '家庭支持度标签' },
|
||||
{ id: 39, sort: 6, name: '付费能力标签' },
|
||||
{ id: 40, sort: 7, name: '需求紧迫度标签' },
|
||||
{ id: 41, sort: 8, name: '核心问题标签' },
|
||||
{ id: 42, sort: 9, name: '干预难度标签' },
|
||||
{ id: 43, sort: 10, name: '转化优先级标签' },
|
||||
{ id: 44, sort: 11, name: '渠道适配标签' },
|
||||
{ id: 45, sort: 12, name: '产品匹配标签' },
|
||||
{ id: 47, sort: 13, name: '文化程度' },
|
||||
{ id: 48, sort: 14, name: '服务周期标签' }
|
||||
];
|
||||
|
||||
const stmt = db.prepare('UPDATE tag_categories SET sort_order = ? WHERE id = ?');
|
||||
|
||||
for (const item of updates) {
|
||||
stmt.run(item.sort, item.id);
|
||||
console.log(`${item.sort + 1}. ${item.name}`);
|
||||
}
|
||||
|
||||
console.log('\n✅ 完成!');
|
||||
|
||||
db.close();
|
||||
Reference in New Issue
Block a user