|
|
|
@ -109,7 +109,6 @@ class User < Principal
|
|
|
|
|
has_many :contests, :foreign_key => 'author_id', :dependent => :destroy
|
|
|
|
|
has_many :softapplications, :foreign_key => 'user_id', :dependent => :destroy
|
|
|
|
|
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
|
|
|
|
has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1"
|
|
|
|
|
has_many :journal_replies, :dependent => :destroy
|
|
|
|
|
has_many :activities, :dependent => :destroy
|
|
|
|
|
has_many :students_for_courses
|
|
|
|
@ -131,6 +130,9 @@ class User < Principal
|
|
|
|
|
# 关联虚拟表
|
|
|
|
|
has_many :forge_messages
|
|
|
|
|
# end
|
|
|
|
|
# 虚拟转换
|
|
|
|
|
has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1"
|
|
|
|
|
has_many :issue_assigns, :class_name => 'ForgeMessage', :conditions => 'viewed=0 and forge_message_type="Issue"'
|
|
|
|
|
|
|
|
|
|
# 邮件邀请状态
|
|
|
|
|
# has_many :invite_lists
|
|
|
|
@ -246,10 +248,7 @@ class User < Principal
|
|
|
|
|
|
|
|
|
|
# 查询指派给我的缺陷记录
|
|
|
|
|
def count_new_issue_assign_to
|
|
|
|
|
# count = self.forge_messages.where("viewed=? and forge_message_type=?", 0,Issue).count
|
|
|
|
|
|
|
|
|
|
self.forge_messages(:conditions => ["viewed=? and forge_message_type=?", 0,Issue])
|
|
|
|
|
#issue_assign_count = issue_assign_messages.count
|
|
|
|
|
self.issue_assigns
|
|
|
|
|
end
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|