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({
|
||||
where: {
|
||||
name: {
|
||||
[Op.like]: `%${req.query.q}%`
|
||||
[Op.or]: {
|
||||
name: {
|
||||
[Op.like]: `%${req.query.q}%`
|
||||
},
|
||||
'$Properties.value$': {
|
||||
[Op.like]: `%${req.query.q}%`
|
||||
}
|
||||
}
|
||||
},
|
||||
include: ['Type'],
|
||||
include: ['Type', 'Properties'],
|
||||
order: [
|
||||
['name', 'ASC']
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue