From 007fee95bd11cf2c17820a35edea7a1c9d398d4b Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 9 Apr 2016 14:41:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=92=8C=E7=95=99=E8=A8=80?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E7=9A=84=E6=A8=A1=E6=9D=BF=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journals_for_message.rb | 10 +++++----- public/javascripts/wechat/app.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 99cc8229b..22bc33cd1 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -257,7 +257,7 @@ class JournalsForMessage < ActiveRecord::Base end end if self.jour_type == 'HomeworkCommon' - journal_wechat_message '您的作业有新回复了' + journal_wechat_message '您的作业有新回复了',self.jour.user_id end end @@ -270,7 +270,7 @@ class JournalsForMessage < ActiveRecord::Base if self.reply_id == 0 if self.user_id != self.jour_id # 过滤自己给自己的留言消息 receivers << self.jour - journal_wechat_message "您有新留言了" + journal_wechat_message "您有新留言了",self.jour_id end else # 留言回复 reply_to = User.find(self.reply_id) @@ -280,7 +280,7 @@ class JournalsForMessage < ActiveRecord::Base if self.user_id != self.parent.jour_id && self.reply_id != self.parent.jour_id # 给东家发信息,如果回复的对象是东家则不发 receivers << self.parent.jour end - journal_wechat_message "您的留言有新回复了" + journal_wechat_message "您的留言有新回复了",self.reply_id end receivers.each do |r| self.user_feedback_messages << UserFeedbackMessage.new(:user_id => r.id, :journals_for_message_id => self.id, :journals_for_message_type => "Principal", :viewed => false) @@ -308,8 +308,8 @@ class JournalsForMessage < ActiveRecord::Base end #微信模板消息 - def journal_wechat_message type - uw = UserWechat.where(user_id: self.reply_id).first + def journal_wechat_message type, user_id + uw = UserWechat.where(user_id: user_id).first #unless uw.nil? && self.reply_id != User.current.id unless uw.nil? data = { diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index db460655f..25cb0f169 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -10,7 +10,7 @@ app.factory('auth', function($http,$routeParams, $cookies, $q){ var _openid = ''; if(debug===true){ - _openid = "1"; + _openid = "6"; } var getOpenId = function() {