From c373e4b62cdfc41c038fd97c24d7e12ac7aacfdc Mon Sep 17 00:00:00 2001 From: luoyonghuang <2308014474@qq.com> Date: Wed, 9 Oct 2024 11:19:06 +0800 Subject: [PATCH] Delete 'ranking.js' --- ranking.js | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 ranking.js diff --git a/ranking.js b/ranking.js deleted file mode 100644 index 1b2a6b5..0000000 --- a/ranking.js +++ /dev/null @@ -1,14 +0,0 @@ -const pool = require('../db'); - -async function getRanking(req, res) { - try { - const connection = await pool.getConnection(); - const [ranking] = await connection.query('SELECT student_name, student_id, score, call_count FROM students ORDER BY score DESC'); - connection.release(); - res.send({ ranking }); - } catch (error) { - res.status(500).send({ error: '无法获取排名' }); - } -} - -module.exports = { getRanking };