diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index f2b69da81..9551ff28b 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -117,6 +117,15 @@ class JournalsForMessage < ActiveRecord::Base update_all("m_reply_count = #{count.to_i}", ["id = ?", journals_for_messages.m_parent_id]) end + #如果是在项目中留言则返回该项目否则返回nil - zjc + def project + if self.jour_type == 'Project' + Project.find(self.jour_id) + else + nil + end + end + # 更新用户分数 -by zjc def be_user_score #新建了留言回复