Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. CustomerPersonsRelation()
  2. CustomerShop()
  3. var result = await CustomerModel.findAll({
  4. ...params,
  5. include: [
  6. {model : ShopModel},
  7. {model: ContactPersonModel}
  8. ]
  9. })
  10.  
  11. {
  12. where: {
  13. $or: [
  14. {
  15. '$Customer.customer_name$': { $like: '%' + search + '%' },
  16. },
  17. {
  18. '$Customer.customer_fiscal_name$': { $like: '%' + search + '%' },
  19. },
  20. {
  21. '$Customer.customer_responsable_name$': { $like: '%' + search + '%' },
  22. },
  23. {
  24. '$Customer.customer_responsable_phone$': { $like: '%' + search + '%' },
  25. },
  26. {
  27. '$Customer.customer_web$': { $like: '%' + search + '%' },
  28. },
  29. {
  30. '$Shops.shop_name$': { $like: '%' + search + '%' },
  31. },
  32. {
  33. '$Shops.shop_phone$': { $like: '%' + search + '%' },
  34. },
  35. {
  36. '$Shops.shop_mobile$': { $like: '%' + search + '%' },
  37. },
  38. {
  39. '$ContactPersons.contactp_name$': { $like: '%' + search + '%' },
  40. },
  41. {
  42. '$ContactPersons.contactp_phone$': { $like: '%' + search + '%' },
  43. },
  44. {
  45. '$ContactPersons.contactp_mobile$': { $like: '%' + search + '%' },
  46. }
  47. ]
  48. },
  49. limit: 3
  50. })
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement