Merge branch 'hjq_mail' into develop

This commit is contained in:
huang 2016-05-23 15:03:45 +08:00
commit 96223b414d
3 changed files with 19 additions and 15 deletions

View File

@ -163,13 +163,13 @@ class News < ActiveRecord::Base
end end
end end
#课程/项目通知 消息发送 # 课程/项目通知 消息发送
#消息发送原则:除了消息的发布者,课程的其它成员都能收到消息提醒 # 消息发送原则:除了消息的发布者,课程的其它成员都能收到消息提醒
def act_as_system_message def act_as_system_message
if self.course if self.course
self.course.members.each do |m| self.course.members.each do |m|
if m.user_id != self.author_id if m.user_id != self.author_id
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) self.delay.send_message(m.user_id, self.course_id)
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
if count == 0 if count == 0
ws = WechatService.new ws = WechatService.new
@ -189,6 +189,10 @@ class News < ActiveRecord::Base
end end
end end
def send_message user_id, course_id
self.course_messages << CourseMessage.new(:user_id => user_id, :course_id => course_id, :viewed => false)
end
# Time 2015-03-31 13:50:54 # Time 2015-03-31 13:50:54
# Author lizanle # Author lizanle
# Description 删除news后删除对应的资源 # Description 删除news后删除对应的资源

View File

@ -6,15 +6,15 @@
<p class="pro_page_tit" style="word-break:break-all;"> <p class="pro_page_tit" style="word-break:break-all;">
<% case @issue.tracker_id %> <% case @issue.tracker_id %>
<% when 1%> <% when 1%>
<span class="issues fl" title="缺陷"></span> <span class="fl" title="缺陷">【缺陷】</span>
<% when 2%> <% when 2%>
<span class="issues-function fl" title="功能"></span> <span class="fl" title="功能">【功能】</span>
<% when 3%> <% when 3%>
<span class="support fl" title="支持"></span> <span class="fl" title="支持">【支持】</span>
<% when 4%> <% when 4%>
<span class="duty fl" title="任务"></span> <span class="fl" title="任务">【任务】</span>
<% when 5%> <% when 5%>
<span class="weekly fl" title="周报"></span> <span class="fl" title="周报">【周报】</span>
<% end %> <% end %>
</span> <span style="padding-left: 5px;"><%= @issue.subject %></span> </span> <span style="padding-left: 5px;"><%= @issue.subject %></span>
<span class='<%= "#{get_issue_priority(@issue.priority_id)[0]} " %>'><%= get_issue_priority(@issue.priority_id)[1] %></span></p> <span class='<%= "#{get_issue_priority(@issue.priority_id)[0]} " %>'><%= get_issue_priority(@issue.priority_id)[1] %></span></p>

View File

@ -39,15 +39,15 @@
<div class="homepagePostTitle break_word"> <div class="homepagePostTitle break_word">
<% case activity.tracker_id %> <% case activity.tracker_id %>
<% when 1%> <% when 1%>
<span class="issues fl" title="缺陷"></span> <span class="fl" title="缺陷">【缺陷】</span>
<% when 2%> <% when 2%>
<span class="issues-function fl" title="功能"></span> <span class="fl" title="功能">【功能】</span>
<% when 3%> <% when 3%>
<span class="support fl" title="支持"></span> <span class="fl" title="支持">【支持】</span>
<% when 4%> <% when 4%>
<span class="duty fl" title="任务"></span> <span class="fl" title="任务">【任务】</span>
<% when 5%> <% when 5%>
<span class="weekly fl" title="周报"></span> <span class="fl" title="周报">【周报】</span>
<% end %> <% end %>
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5" %> <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5" %>
<span class='<%= get_issue_priority(activity.priority_id)[0] %>'> <span class='<%= get_issue_priority(activity.priority_id)[0] %>'>