Codex Assistant
21 小时以前 58d9f460b2f8c34430285115e2557d18333c5cab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
const mysql = require('mysql2/promise');
 
async function checkUserJudgeInfo() {
    const connection = await mysql.createConnection({
        host: '139.155.104.10',
        port: 3306,
        user: 'ryc',
        password: 'KiYap3E8X8RLcM6T',
        database: 'ryc'
    });
 
    try {
        console.log('检查用户ID=152的信息...\n');
 
        // 检查用户基本信息
        const [userRows] = await connection.execute(
            'SELECT id, name, phone, wx_openid FROM t_user WHERE id = ?',
            [152]
        );
        
        if (userRows.length > 0) {
            console.log('用户基本信息:');
            console.log(userRows[0]);
        } else {
            console.log('未找到用户ID=152的记录');
            return;
        }
 
        // 检查评委信息
        const [judgeRows] = await connection.execute(
            'SELECT id, user_id, name, title, company, state FROM t_judge WHERE user_id = ?',
            [152]
        );
        
        if (judgeRows.length > 0) {
            console.log('\n评委信息:');
            console.log(judgeRows[0]);
        } else {
            console.log('\n未找到该用户的评委记录');
        }
 
        // 检查员工信息
        const [employeeRows] = await connection.execute(
            'SELECT id, user_id, name, phone, role_id, state FROM t_employee WHERE user_id = ?',
            [152]
        );
        
        if (employeeRows.length > 0) {
            console.log('\n员工信息:');
            console.log(employeeRows[0]);
        } else {
            console.log('\n未找到该用户的员工记录');
        }
 
        // 检查学员信息
        const [playerRows] = await connection.execute(
            'SELECT id, user_id, name, phone, state FROM t_player WHERE user_id = ?',
            [152]
        );
        
        if (playerRows.length > 0) {
            console.log('\n学员信息:');
            console.log(playerRows[0]);
        } else {
            console.log('\n未找到该用户的学员记录');
        }
 
    } catch (error) {
        console.error('查询失败:', error);
    } finally {
        await connection.end();
    }
}
 
checkUserJudgeInfo().catch(console.error);