feat(activity): implement P4 member self-service leave and ticket refund channel

这个提交包含在:
xcbyy
2026-10-10 15:56:55 +08:00
父节点 7ac81035b4
当前提交 3a700c42a1
共有 5 个文件被更改,包括 147 次插入 和 7 次删除

查看文件

@@ -152,6 +152,7 @@ export async function initDatabase(): Promise<void> {
CREATE TABLE IF NOT EXISTS finance_records (
id VARCHAR(64) PRIMARY KEY,
record_no VARCHAR(64) UNIQUE NOT NULL,
user_id INT,
type VARCHAR(64) NOT NULL,
amount DECIMAL(10,2) NOT NULL,
direction VARCHAR(8) NOT NULL DEFAULT 'IN',
@@ -161,6 +162,10 @@ export async function initDatabase(): Promise<void> {
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
`);
try {
await conn.query('ALTER TABLE finance_records ADD COLUMN user_id INT AFTER record_no');
} catch (_) {}
// 7. 提现申请表
await conn.query(`
CREATE TABLE IF NOT EXISTS withdrawals (

查看文件

@@ -396,7 +396,7 @@ export class MysqlRepository {
await conn.query(`
INSERT INTO finance_records (id, record_no, user_id, type, amount, direction, counterparty, related_id)
VALUES (?, ?, ?, '成员退席原路退款', ?, 'IN', ?, ?)
`, [finId, recordNo, userId, (refundAmount / 100).toFixed(2), `组局 ${id}`, id]);
`, [finId, recordNo, userId, (refundAmount / 100).toFixed(2), `用户 ${userId} (组局退款)`, id]);
await conn.commit();
return {