Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Zukqurnain committed May 13, 2022
1 parent 1c1953e commit 705eed1
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions backend/controllers/attendance_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,23 @@ module.exports.report = (req, res) => {
},
'Leave': {
'$sum': {

$cond: [{ $eq: ['$TransactionType', "Leave"] }, 1, 0],

$cond: [{ $eq: ['$TransactionType', "Leave",'$ApprovedDetails', true
] }, 1, 0]

'$cond': [
{
'$and': [
{
'$eq': [
'$TransactionType', 'Leave'
]
}, {
'$eq': [
'$ApprovedDetails.ActionTakenOn', true
]
}
]
}, 1, 0
]
}
},
},
}
}
]
Expand Down

0 comments on commit 705eed1

Please sign in to comment.