up
This commit is contained in:
@@ -27,7 +27,9 @@ module.exports.createAward = [
|
|||||||
|
|
||||||
module.exports.findAllUser = async (req, res) => {
|
module.exports.findAllUser = async (req, res) => {
|
||||||
const toDay = new Date()
|
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 awardsReq = await AwardRequest.find({ userId: req.user_id }).populate('awardId', '-created_at -updated_at')
|
||||||
const score = await GPSUser.findById(req.user_id, { score: 1 })
|
const score = await GPSUser.findById(req.user_id, { score: 1 })
|
||||||
// eslint-disable-next-line array-callback-return
|
// eslint-disable-next-line array-callback-return
|
||||||
@@ -49,7 +51,7 @@ module.exports.findAllUser = async (req, res) => {
|
|||||||
},
|
},
|
||||||
status: 1
|
status: 1
|
||||||
}
|
}
|
||||||
} else {
|
} else if(award.expireDate < toDay){
|
||||||
return {
|
return {
|
||||||
id: award.id,
|
id: award.id,
|
||||||
score: award.score,
|
score: award.score,
|
||||||
|
|||||||
Reference in New Issue
Block a user