This commit is contained in:
2025-09-15 17:28:12 +08:00
parent 185bc88e21
commit 318e6f56a9
9 changed files with 887 additions and 577 deletions

View File

@@ -170,7 +170,8 @@ router.get('/directly_operated', agentAuth, async (req, res) => {
// 构建查询条件
let whereConditions = ['u.inviter = ?'];
let queryParams = [agentId];
whereConditions.push('u.user_type = ?')
queryParams.push('directly_operated');
// 添加搜索条件
if (search) {
whereConditions.push('(u.username LIKE ? OR u.real_name LIKE ? OR u.phone LIKE ?)');
@@ -324,7 +325,7 @@ router.post('/withdraw', agentAuth, async (req, res) => {
WHERE id = ?`, [amount, userId])
await db.execute(
'INSERT INTO transfers (from_user_id, to_user_id, transfer_type,status,amount,description,source_type) VALUES (?, ?, ?,?,?,?,?)',
[agentId, userId, 'agent_to_operated', 'received', amount, '直营商户提现', 'agent']
[agentId, userId, 'agent_to_operated', 'received', amount, '直营商户提现', 'withdraw']
);
// 提交事务
await db.query('COMMIT');