diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 0d0b82752..4981d12f1 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -104,7 +104,7 @@ class Mailer < ActionMailer::Base # 查询user的缺陷,项目中成员都能收到 sql = "select DISTINCT * from members m, issues i where i.project_id = m.project_id and m.user_id='#{user.id}' - and (i.updated_on between '#{date_from}' and '#{date_to}') order by i.updated_on desc" + and (i.updated_on between '#{date_from}' and '#{date_to}') order by i.project_id, i.updated_on desc" @issues = Issue.find_by_sql(sql) # issue回复 @@ -125,7 +125,7 @@ class Mailer < ActionMailer::Base @bids += bids if bids.count > 0 @attachments += attachments if attachments.count > 0 end - @bids.sort {|a, b| a.created_at <=> b.created_at} + @bids = @bids.sort_by { |obj| obj.created_at } end # 项目附件