初次提交
This commit is contained in:
31
add_commission.js
Normal file
31
add_commission.js
Normal file
@@ -0,0 +1,31 @@
|
||||
const { initDB, getDB } = require('./database');
|
||||
|
||||
async function addCommission() {
|
||||
try {
|
||||
await initDB();
|
||||
const db = getDB();
|
||||
|
||||
// 手动添加佣金记录
|
||||
await db.execute(
|
||||
'INSERT INTO agent_commission_records (agent_id, merchant_id, commission_amount, commission_type, description, created_at) VALUES (?, ?, ?, "matching", "用户完成第三次转账获得的代理佣金", NOW())',
|
||||
[4, 9294, 39.9]
|
||||
);
|
||||
|
||||
console.log('已手动添加佣金记录');
|
||||
|
||||
// 验证佣金记录是否添加成功
|
||||
const [commissions] = await db.execute(
|
||||
'SELECT * FROM agent_commission_records WHERE agent_id = ? AND merchant_id = ?',
|
||||
[4, 9294]
|
||||
);
|
||||
|
||||
console.log('佣金记录:', commissions);
|
||||
|
||||
} catch (error) {
|
||||
console.error('添加佣金记录失败:', error);
|
||||
} finally {
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
addCommission();
|
||||
Reference in New Issue
Block a user