Improved Search
This commit is contained in:
parent
c121746380
commit
53cebca836
1 changed files with 8 additions and 3 deletions
|
@ -160,11 +160,16 @@ class Vegetables {
|
||||||
}
|
}
|
||||||
vegetables.findAndCountAll({
|
vegetables.findAndCountAll({
|
||||||
where: {
|
where: {
|
||||||
name: {
|
[Op.or]: {
|
||||||
[Op.like]: `%${req.query.q}%`
|
name: {
|
||||||
|
[Op.like]: `%${req.query.q}%`
|
||||||
|
},
|
||||||
|
'$Properties.value$': {
|
||||||
|
[Op.like]: `%${req.query.q}%`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
include: ['Type'],
|
include: ['Type', 'Properties'],
|
||||||
order: [
|
order: [
|
||||||
['name', 'ASC']
|
['name', 'ASC']
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue