Merge branch 'develop' into szzh

tmp
sw 10 years ago
commit fd976b4524

@ -433,7 +433,7 @@ module UserScoreHelper
#协同得分 #协同得分
def collaboration(option_number) def collaboration(option_number)
option_number.messages_for_issues + option_number.issues_status + option_number.replay_for_message + option_number.replay_for_memo option_number.memo * 2 + option_number.messages_for_issues + option_number.issues_status + option_number.replay_for_message + option_number.replay_for_memo
end end
#影响力得分 #影响力得分
def influence(option_number) def influence(option_number)
@ -445,7 +445,7 @@ module UserScoreHelper
end end
#项目贡献得分 #项目贡献得分
def active(option_number) def active(option_number)
option_number.changeset * 4 + option_number.document * 4 + option_number.attachment * 4 + option_number.issue_done_ratio * 2 + option_number.post_issue * 4 + option_number.memo * 2 option_number.changeset * 4 + option_number.document * 4 + option_number.attachment * 4 + option_number.issue_done_ratio * 2 + option_number.post_issue * 4
end end
#更新发帖数 #更新发帖数

@ -15,6 +15,8 @@ class CourseMessage < ActiveRecord::Base
after_create :add_user_message after_create :add_user_message
def add_user_message def add_user_message
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
self.message_alls << MessageAll.new(:user_id => self.user_id) self.message_alls << MessageAll.new(:user_id => self.user_id)
end end
end
end end

@ -22,6 +22,8 @@ class ForgeMessage < ActiveRecord::Base
after_create :add_user_message after_create :add_user_message
def add_user_message def add_user_message
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
self.message_alls << MessageAll.new(:user_id => self.user_id) self.message_alls << MessageAll.new(:user_id => self.user_id)
end end
end
end end

@ -12,6 +12,8 @@ class MemoMessage < ActiveRecord::Base
after_create :add_user_message after_create :add_user_message
def add_user_message def add_user_message
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
self.message_alls << MessageAll.new(:user_id => self.user_id) self.message_alls << MessageAll.new(:user_id => self.user_id)
end end
end
end end

@ -493,24 +493,25 @@ class Query < ActiveRecord::Base
def project_statement def project_statement
project_clauses = [] project_clauses = []
# unless project.descendants.blank? # unless project.descendants.blank?
if project && project.descendants && project.descendants.active && !project.descendants.active.empty? # if project && project.descendants && project.descendants.active && !project.descendants.active.empty?
ids = [project.id] # ids = [project.id]
if has_filter?("subproject_id") # if has_filter?("subproject_id")
case operator_for("subproject_id") # case operator_for("subproject_id")
when '=' # when '='
# include the selected subprojects # # include the selected subprojects
ids += values_for("subproject_id").each(&:to_i) # ids += values_for("subproject_id").each(&:to_i)
when '!*' # when '!*'
# main project only # # main project only
else # else
# all subprojects # # all subprojects
ids += project.descendants.collect(&:id) # ids += project.descendants.collect(&:id)
end # end
elsif Setting.display_subprojects_issues? # elsif Setting.display_subprojects_issues?
ids += project.descendants.collect(&:id) # ids += project.descendants.collect(&:id)
end # end
project_clauses << "#{Project.table_name}.id IN (%s)" % ids.join(',') # project_clauses << "#{Project.table_name}.id IN (%s)" % ids.join(',')
elsif project # elsif project
if project
project_clauses << "#{Project.table_name}.id = %d" % project.id project_clauses << "#{Project.table_name}.id = %d" % project.id
end end
# end # end

@ -11,6 +11,8 @@ class UserFeedbackMessage < ActiveRecord::Base
after_save :add_user_message after_save :add_user_message
def add_user_message def add_user_message
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
self.message_alls << MessageAll.new(:user_id => self.user_id) self.message_alls << MessageAll.new(:user_id => self.user_id)
end end
end
end end

Loading…
Cancel
Save