still nfc

This commit is contained in:
Yan
2017-07-17 15:07:27 +06:30
parent b2ccc12e17
commit 51c14f379b
5 changed files with 30 additions and 12 deletions

View File

@@ -194,7 +194,7 @@ class Customer < ApplicationRecord
def self.search(search)
if search
# find(:all, :conditions => ['name LIKE ? OR contact_no LIKE ?', "%#{search}%", "%#{search}%"])
where("name LIKE ? OR contact_no LIKE ? OR card_no LIKE ?", "%#{search}%", "%#{search}%", "%#{search}%",)
where("name LIKE ? OR contact_no LIKE ? OR card_no LIKE ? OR paypar_account_no ='#{search}'", "%#{search}%", "%#{search}%", "%#{search}%",)
else
find(:all)
end