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