From a262f86100a78a1f62526589837933dabdb068ed Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 15 May 2015 14:02:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E7=BB=A9=E6=9F=A5=E8=AF=A2=E6=88=91?= =?UTF-8?q?=E6=80=BB=E6=98=AF=E5=9C=A8=E6=9C=80=E4=B8=8A=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/courses.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index 0900f0446..18fa0dc86 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -274,6 +274,13 @@ module Mobile get ":course_id/members" do cs = CoursesService.new 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 :status, 0 end