fix timezone

This commit is contained in:
Thein Lin Kyaw
2023-02-10 14:50:30 +06:30
parent 944f7a7259
commit 5d9281e196
18 changed files with 54 additions and 54 deletions

View File

@@ -389,7 +389,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 customer_type LIKE ? OR contact_no LIKE ? OR card_no LIKE ? OR DATE_FORMAT(CONVERT_TZ(date_of_birth,'+00:00', Time.zone.formatted_offset),'%Y-%m-%d') LIKE ? OR nrc_no LIKE ? OR gender LIKE ? OR paypar_account_no ='#{search}'", "%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%")
where("name LIKE ? OR customer_type LIKE ? OR contact_no LIKE ? OR card_no LIKE ? OR DATE_FORMAT(CONVERT_TZ(date_of_birth, '+00:00', '<%= Time.zone.formatted_offset %>'), '%Y-%m-%d') LIKE ? OR nrc_no LIKE ? OR gender LIKE ? OR paypar_account_no ='#{search}'", "%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%")
else
find(:all)
end