Commit 6d68f04b authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 3a3c250f
......@@ -340,6 +340,7 @@ async function reportRequest(msg, date) {
break
}
let reqs = await db.getRequestByDate(msg.data, date)
console.log(reqs)
message.deleteMessage(bot, msg)
message.listRequest(bot, msg, reqs)
}
......
......@@ -263,7 +263,7 @@ async function getAllUsers() {
})
}
async function getRequestByDate(userId, startDate,endDate) {
async function getRequestByDate(userId, date) {
return await Request.findAll({
......@@ -271,8 +271,7 @@ async function getRequestByDate(userId, startDate,endDate) {
where: {
user_request: userId,
createdAt: {
[Op.gte]: startDate,
[Op.lte]:endDate
[Op.gte]: moment().subtract(date, 'days').toDate()
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment