- filtro se GAS o Prodotti
This commit is contained in:
@@ -295,7 +295,22 @@ module.exports.findAllIdApp = async function (idapp, code, id) {
|
||||
$expr: {
|
||||
$and: [
|
||||
{ $eq: ['$idProduct', '$$productId'] },
|
||||
{ $lt: ['$status', shared_consts.OrderStatus.ORDER_CONFIRMED] }
|
||||
{
|
||||
$or: [
|
||||
{
|
||||
$eq: ['$status', shared_consts.OrderStatus.CHECKOUT_SENT]
|
||||
},
|
||||
{
|
||||
$and: [{ $lt: ['$status', shared_consts.OrderStatus.CHECKOUT_SENT] },
|
||||
{
|
||||
$gt: [
|
||||
'$modify_at',
|
||||
{ $subtract: [new Date(), 60 * 60 * 1000] } // 1 hour in milliseconds 60 * 60
|
||||
]
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -320,7 +335,22 @@ module.exports.findAllIdApp = async function (idapp, code, id) {
|
||||
$expr: {
|
||||
$and: [
|
||||
{ $eq: ['$idProduct', '$$productId'] },
|
||||
{ $lt: ['$status', shared_consts.OrderStatus.ORDER_CONFIRMED] }
|
||||
{
|
||||
$or: [
|
||||
{
|
||||
$eq: ['$status', shared_consts.OrderStatus.CHECKOUT_SENT]
|
||||
},
|
||||
{
|
||||
$and: [{ $lt: ['$status', shared_consts.OrderStatus.CHECKOUT_SENT] },
|
||||
{
|
||||
$gt: [
|
||||
'$modify_at',
|
||||
{ $subtract: [new Date(), 60 * 60 * 1000] } // 1 hour in milliseconds 60 * 60
|
||||
]
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user