From 0c115fe8067f95503aff053e90c13721535545a3 Mon Sep 17 00:00:00 2001 From: Dung Nguyen <> Date: Thu, 3 Mar 2022 18:32:14 +0700 Subject: [PATCH] =?UTF-8?q?th=C3=AAm=20query=20l=E1=BB=8Bch=20s=E1=BB=AD?= =?UTF-8?q?=20theo=20ng=C3=A0y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 19546c8..89070b7 100644 --- a/index.js +++ b/index.js @@ -260,7 +260,7 @@ puppeteer 5. /set_money_enter:number1,number2 - Vào tiền khi đủ điều kiện; 6. /history - Vào tiền khi đủ điều kiện; 7. /check_tk - Check tiền ví; -8. /view_history - Xem toàn bộ lịch sử vào lệnh;`, +8. /view_history:[date] - Xem toàn bộ lịch sử vào lệnh; Ví dụ /view_history:3/3/2022`, { parse_mode: "HTML" } ); return; @@ -348,8 +348,9 @@ SELL: /sell:[number]`, } if (text.startsWith('/view_history')) { + const dateQuery = text.replace('/view_history:'); db.query( - `SELECT * FROM histories ORDER BY id desc`, + `SELECT * FROM histories WHERE time like '%${dateQuery}' ORDER BY id asc`, [], (error, results) => { if (error) { console.log(error);