From 9136da7972c7bde9ab12dfeff505b20b386ccc47 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 11 Nov 2016 15:53:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/homework_common.rb | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index c87cd3d42..ae8cf3654 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -73,24 +73,24 @@ class HomeworkCommon < ActiveRecord::Base if self.homework_detail_manual.comment_status == 0 self.course_messages.destroy_all else - # self.course.members.each do |m| - # # if m.user_id != self.user_id - # #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) - # rolesids = [] - # m.roles.each do |role| - # rolesids << role.id - # end - # if rolesids.include?(10) - # 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 - # ws = WechatService.new - # name = self.course.syllabus.nil? ? self.course.name : self.course.syllabus.title+" • "+self.course.name - # ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name},#{l(:label_new_homework_template)}", name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。") - # end - # end - # # end - # end - self.delay.send_homework_wechat_message_delay + self.course.members.each do |m| + # if m.user_id != self.user_id + #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) + rolesids = [] + m.roles.each do |role| + rolesids << role.id + end + if rolesids.include?(10) + 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 + ws = WechatService.new + name = self.course.syllabus.nil? ? self.course.name : self.course.syllabus.title+" • "+self.course.name + ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name},#{l(:label_new_homework_template)}", name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。") + end + end + # end + end + # self.delay.send_homework_wechat_message_delay end end end From 0710ddb7d18b65a0a099045bce09573a3c709dc4 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 11 Nov 2016 16:41:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/homework_common.rb | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index ae8cf3654..c87cd3d42 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -73,24 +73,24 @@ class HomeworkCommon < ActiveRecord::Base if self.homework_detail_manual.comment_status == 0 self.course_messages.destroy_all else - self.course.members.each do |m| - # if m.user_id != self.user_id - #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) - rolesids = [] - m.roles.each do |role| - rolesids << role.id - end - if rolesids.include?(10) - 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 - ws = WechatService.new - name = self.course.syllabus.nil? ? self.course.name : self.course.syllabus.title+" • "+self.course.name - ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name},#{l(:label_new_homework_template)}", name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。") - end - end - # end - end - # self.delay.send_homework_wechat_message_delay + # self.course.members.each do |m| + # # if m.user_id != self.user_id + # #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) + # rolesids = [] + # m.roles.each do |role| + # rolesids << role.id + # end + # if rolesids.include?(10) + # 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 + # ws = WechatService.new + # name = self.course.syllabus.nil? ? self.course.name : self.course.syllabus.title+" • "+self.course.name + # ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name},#{l(:label_new_homework_template)}", name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。") + # end + # end + # # end + # end + self.delay.send_homework_wechat_message_delay end end end From 5fd00ae4727d718741aec9e0ef0ad0daae1adad5 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Mon, 14 Nov 2016 10:35:40 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=85=B3=E6=B3=A8=E5=AE=98=E6=96=B9?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=94=B9=E4=B8=BA=E5=85=B3=E6=B3=A8=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1APP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_forbidden_new_feedback.html.erb | 2 +- app/views/layouts/_new_feedback.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_forbidden_new_feedback.html.erb b/app/views/layouts/_forbidden_new_feedback.html.erb index 88696a94b..baf9bd9a6 100644 --- a/app/views/layouts/_forbidden_new_feedback.html.erb +++ b/app/views/layouts/_forbidden_new_feedback.html.erb @@ -35,7 +35,7 @@

加入QQ群

-

关注官方微信

+

关注微信APP

diff --git a/app/views/layouts/_new_feedback.html.erb b/app/views/layouts/_new_feedback.html.erb index 690317127..d2c878698 100644 --- a/app/views/layouts/_new_feedback.html.erb +++ b/app/views/layouts/_new_feedback.html.erb @@ -34,7 +34,7 @@

加入QQ群

-

关注官方微信

+

关注微信APP