From 35fc79eb5735a19905118d4fe9c4ebcad5b57951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincze=20J=C3=B3zsef?= Date: Mon, 16 Sep 2024 11:52:02 +0200 Subject: [PATCH] =?UTF-8?q?Munka=20keres=C3=A9se=20a=20megrendel=C5=91k=20?= =?UTF-8?q?szerint=20hozz=C3=A1adva.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 0057f88..4ed05b3 100644 --- a/app.js +++ b/app.js @@ -542,7 +542,22 @@ app.post('/apiPostDailyReport/:apiKey',function(req,res){ app.get('/filter', utils.ensureAuthenticated, function(req, res) { //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){ if (err)