Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CustomerPersonsRelation()
- CustomerShop()
- var result = await CustomerModel.findAll({
- ...params,
- include: [
- {model : ShopModel},
- {model: ContactPersonModel}
- ]
- })
- {
- where: {
- $or: [
- {
- '$Customer.customer_name$': { $like: '%' + search + '%' },
- },
- {
- '$Customer.customer_fiscal_name$': { $like: '%' + search + '%' },
- },
- {
- '$Customer.customer_responsable_name$': { $like: '%' + search + '%' },
- },
- {
- '$Customer.customer_responsable_phone$': { $like: '%' + search + '%' },
- },
- {
- '$Customer.customer_web$': { $like: '%' + search + '%' },
- },
- {
- '$Shops.shop_name$': { $like: '%' + search + '%' },
- },
- {
- '$Shops.shop_phone$': { $like: '%' + search + '%' },
- },
- {
- '$Shops.shop_mobile$': { $like: '%' + search + '%' },
- },
- {
- '$ContactPersons.contactp_name$': { $like: '%' + search + '%' },
- },
- {
- '$ContactPersons.contactp_phone$': { $like: '%' + search + '%' },
- },
- {
- '$ContactPersons.contactp_mobile$': { $like: '%' + search + '%' },
- }
- ]
- },
- limit: 3
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement