Munka keresése a megrendelők szerint hozzáadva.
This commit is contained in:
parent
af99b3b422
commit
35fc79eb57
17
app.js
17
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue