From: YOSHIDA Hiroki Date: Thu, 14 Mar 2013 02:20:20 +0000 (+0900) Subject: メルマガ配信先検索: 顧客名(カナ)と最終購入日で正しく検索できない不具合を修正 X-Git-Tag: 3.0.0~1^2~1 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=97a200831571d1ef66622fe2fb9a994cd7bbe9a1;p=elecoma%2Felecoma.git メルマガ配信先検索: 顧客名(カナ)と最終購入日で正しく検索できない不具合を修正 --- diff --git a/app/models/mail_magazine.rb b/app/models/mail_magazine.rb index 3f5de86..075abc6 100644 --- a/app/models/mail_magazine.rb +++ b/app/models/mail_magazine.rb @@ -189,7 +189,7 @@ and c.activate = 2 to = condition.updated_at_to unless from.blank? && to.blank? if !from.blank? && !to.blank? - "and #{MergeAdapterUtil.convert_time_to_yyyymmdd('c.updated_at')} >= '#{from.strftime("%Y%m%d")}' + "and (#{MergeAdapterUtil.convert_time_to_yyyymmdd('c.updated_at')} >= '#{from.strftime("%Y%m%d")}' and #{MergeAdapterUtil.convert_time_to_yyyymmdd('c.updated_at')} <= '#{to.strftime("%Y%m%d")}')" elsif !from.blank? "and #{MergeAdapterUtil.convert_time_to_yyyymmdd('c.updated_at')} >= '#{from.strftime("%Y%m%d")}'" @@ -200,10 +200,10 @@ and c.activate = 2 } #{ from = condition.last_order_from - to = condition.last_order_from + to = condition.last_order_to unless from.blank? && to.blank? if !from.blank? && !to.blank? - "and #{MergeAdapterUtil.convert_time_to_yyyymmdd('last_order_at')} >= '#{from.strftime("%Y%m%d")}' + "and (#{MergeAdapterUtil.convert_time_to_yyyymmdd('last_order_at')} >= '#{from.strftime("%Y%m%d")}' and #{MergeAdapterUtil.convert_time_to_yyyymmdd('last_order_at')} <= '#{to.strftime("%Y%m%d")}')" elsif !from.blank? "and #{MergeAdapterUtil.convert_time_to_yyyymmdd('last_order_at')} >= '#{from.strftime("%Y%m%d")}'"