OSDN Git Service

メルマガ配信先検索: 顧客名(カナ)と最終購入日で正しく検索できない不具合を修正
authorYOSHIDA Hiroki <hyoshida@appirits.com>
Thu, 14 Mar 2013 02:20:20 +0000 (11:20 +0900)
committerYOSHIDA Hiroki <hyoshida@appirits.com>
Fri, 14 Jun 2013 07:41:38 +0000 (16:41 +0900)
app/models/mail_magazine.rb

index 3f5de86..075abc6 100644 (file)
@@ -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")}'"