This commit is contained in:
alan 2014-04-01 21:03:52 +08:00
parent 66e655a19e
commit 5c2a037a8f
1 changed files with 4 additions and 1 deletions

View File

@ -662,7 +662,10 @@ class ProjectsController < ApplicationController
def sort_project_members project, members
#userGrade = UserGrade.where(:project_id => project.id)
users = UserGrade.where(:project_id => project.id).order('grade DESC').joins("LEFT JOIN users ON users.id = user_grades.id")
users = UserGrade.where(:project_id => project.id).
order('grade DESC').
joins("LEFT JOIN users ON users.id = user_grades.id").
select("DISTINCT user_grades.user_id")
memberlist = []
users.each do |user|
members.each do |member|