成绩查询我总是在最上方

This commit is contained in:
lizanle 2015-05-15 14:02:41 +08:00
parent 66f8bed978
commit a262f86100
1 changed files with 7 additions and 0 deletions

View File

@ -274,6 +274,13 @@ module Mobile
get ":course_id/members" do get ":course_id/members" do
cs = CoursesService.new cs = CoursesService.new
count = cs.course_members params count = cs.course_members params
# 我如果在学生当中,那么我将放在第一位
count.each do |m|
if m.user.id == current_user.id
count.delete m
count.unshift m
end
end
present :data, count, with: Mobile::Entities::Member present :data, count, with: Mobile::Entities::Member
present :status, 0 present :status, 0
end end