From bb1c7ec16dd1323d01e426969bb1b5d2a74bbcd2 Mon Sep 17 00:00:00 2001 From: satori Date: Sat, 28 Dec 2024 03:39:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=88=86=E7=BB=84=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update.js b/update.js index c898d97..bb1b81b 100644 --- a/update.js +++ b/update.js @@ -96,9 +96,9 @@ export async function update(table, rank, views) { } const JOIN = { - 'comment': `SELECT comment_id AS id, IFNULL(COUNT(*), 0) AS comment_count FROM web_comment WHERE ${WHERE[rank]} GROUP BY id`, - 'praise': `SELECT praise_id AS id, IFNULL(COUNT(*), 0) AS praise_count FROM web_praise WHERE ${WHERE[rank]} GROUP BY id`, - 'collect': `SELECT collect_id AS id, IFNULL(COUNT(*), 0) AS collect_count FROM web_collect WHERE ${WHERE[rank]} GROUP BY id` + 'comment': `SELECT comment_id AS id, IFNULL(COUNT(*), 0) AS comment_count FROM web_comment WHERE ${WHERE[rank]} GROUP BY comment_id`, + 'praise': `SELECT comment_id AS id, IFNULL(COUNT(*), 0) AS praise_count FROM web_praise WHERE ${WHERE[rank]} GROUP BY comment_id`, + 'collect': `SELECT collect_id AS id, IFNULL(COUNT(*), 0) AS collect_count FROM web_collect WHERE ${WHERE[rank]} GROUP BY collect_id` } for (let name of ['comment', 'praise', 'collect']) {