修正詳細評審頁面結果

This commit is contained in:
2025-09-23 22:46:01 +08:00
parent d94b1786d6
commit f018e71577
10 changed files with 558 additions and 24 deletions

40
test-database.js Normal file
View File

@@ -0,0 +1,40 @@
const mysql = require('mysql2/promise');
const dbConfig = {
host: 'mysql.theaken.com',
port: 33306,
user: 'root',
password: 'zh6161168',
database: 'db_AI_scoring'
};
async function checkData() {
let connection;
try {
console.log('🔗 連接到資料庫...');
connection = await mysql.createConnection(dbConfig);
console.log('✅ 資料庫連接成功');
// 檢查評審記錄
const [evaluations] = await connection.execute('SELECT id, project_id, overall_score, grade FROM evaluations LIMIT 5');
console.log('📊 評審記錄:', evaluations);
// 檢查專案記錄
const [projects] = await connection.execute('SELECT id, title, status FROM projects LIMIT 5');
console.log('📋 專案記錄:', projects);
// 檢查評分記錄
const [scores] = await connection.execute('SELECT id, evaluation_id, criteria_item_id, score FROM evaluation_scores LIMIT 5');
console.log('🎯 評分記錄:', scores);
} catch (error) {
console.error('❌ 錯誤:', error.message);
} finally {
if (connection) {
await connection.end();
console.log('🔌 資料庫連接已關閉');
}
}
}
checkData();