This commit is contained in:
morteza-mortezai
2025-12-04 08:50:09 +03:30
parent f2a91bdbf5
commit 3def8f7157
+4 -2
View File
@@ -27,7 +27,9 @@ module.exports.createAward = [
module.exports.findAllUser = async (req, res) => {
const toDay = new Date()
const awards = await Award.find({ expireDate: { $gt: toDay }, isDeleted: false })
const awards = await Award.find({
// expireDate: { $gt: toDay },
isDeleted: false })
const awardsReq = await AwardRequest.find({ userId: req.user_id }).populate('awardId', '-created_at -updated_at')
const score = await GPSUser.findById(req.user_id, { score: 1 })
// eslint-disable-next-line array-callback-return
@@ -49,7 +51,7 @@ module.exports.findAllUser = async (req, res) => {
},
status: 1
}
} else {
} else if(award.expireDate < toDay){
return {
id: award.id,
score: award.score,