Munka keresése a megrendelők szerint hozzáadva.

This commit is contained in:
Vincze József 2024-09-16 11:52:02 +02:00
parent af99b3b422
commit 35fc79eb57
1 changed files with 16 additions and 1 deletions

17
app.js
View File

@ -542,7 +542,22 @@ app.post('/apiPostDailyReport/:apiKey',function(req,res){
app.get('/filter', utils.ensureAuthenticated, function(req, res) { app.get('/filter', utils.ensureAuthenticated, function(req, res) {
//console.log(req.query.year.value); //console.log(req.query.year.value);
var query={$or:[{$and:[{"workDate": { "$regex": req.query.year, "$options": "i" }},{"title":{ "$regex": req.query.condition, "$options": "i" }}]},{$and:[{"workDate": { "$regex": req.query.year, "$options": "i" }},{"poNumber":{ "$regex": req.query.condition, "$options": "i" }}]}]}; var query={
$or:[
{"megrendelo": { "$regex": req.query.condition, "$options": "i" }},
{$and:
[
{"workDate": { "$regex": req.query.year, "$options": "i" }},
{"title":{ "$regex": req.query.condition, "$options": "i" }}
]
},{$and:
[
{"workDate": { "$regex": req.query.year, "$options": "i" }},
{"poNumber":{ "$regex": req.query.condition, "$options": "i" }}
]
}
]
};
Work.find(query,null,{sort: {workNumber: -1}} ,function(err, works){ Work.find(query,null,{sort: {workNumber: -1}} ,function(err, works){
if (err) if (err)