feat(admin): complete post management, finance csv export, and wechat message template config
这个提交包含在:
@@ -436,6 +436,14 @@ export async function initDatabase(): Promise<void> {
|
||||
`);
|
||||
} catch (_) {}
|
||||
|
||||
// 扩展 posts 表结构: is_top (置顶), status (正常/隐藏)
|
||||
try {
|
||||
await conn.query('ALTER TABLE posts ADD COLUMN is_top TINYINT DEFAULT 0');
|
||||
} catch (_) {}
|
||||
try {
|
||||
await conn.query("ALTER TABLE posts ADD COLUMN status VARCHAR(32) DEFAULT '正常'");
|
||||
} catch (_) {}
|
||||
|
||||
// 21. 用户举报工单表 (涉黄/涉赌/线下欺诈等不良陪玩举报)
|
||||
await conn.query(`
|
||||
CREATE TABLE IF NOT EXISTS reports (
|
||||
@@ -814,6 +822,15 @@ async function seedInitialDataIfEmpty(conn: any): Promise<void> {
|
||||
defaultAaFee: 50
|
||||
});
|
||||
|
||||
const messageTemplateRulesVal = JSON.stringify({
|
||||
orderStatusTemplateId: 'tmpl_order_status_update_01',
|
||||
activityJoinTemplateId: 'tmpl_activity_joined_02',
|
||||
withdrawSuccessTemplateId: 'tmpl_withdraw_success_03',
|
||||
verifyCodeTemplateId: 'tmpl_verify_code_notice_04',
|
||||
enablePush: 1,
|
||||
remark: '微信小程序订阅消息与服务通知模版ID配置'
|
||||
});
|
||||
|
||||
const [cfgItemRows]: any = await conn.query('SELECT COUNT(*) as count FROM platform_configs');
|
||||
if (cfgItemRows[0].count === 0) {
|
||||
const customerServiceVal = JSON.stringify({
|
||||
@@ -916,6 +933,12 @@ async function seedInitialDataIfEmpty(conn: any): Promise<void> {
|
||||
VALUES ('activity_rules', '同城组局发单与预算预设规范', ?, '招募席位上下限、快捷单人赏金预设与包场预算梯队', 1)
|
||||
`, [activityRulesVal]);
|
||||
}
|
||||
if (!existingKeys.has('message_template_rules')) {
|
||||
await conn.query(`
|
||||
INSERT INTO platform_configs (config_key, name, value_json, description, status)
|
||||
VALUES ('message_template_rules', '微信服务通知与模板消息配置', ?, '微信订阅消息通知与状态模板配置', 1)
|
||||
`, [messageTemplateRulesVal]);
|
||||
}
|
||||
if (existingKeys.has('platform_protocol')) {
|
||||
const [protoRows]: any = await conn.query("SELECT value_json FROM platform_configs WHERE config_key = 'platform_protocol'");
|
||||
if (protoRows && protoRows.length > 0) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户