diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index 8792959d8..8e8f65bc9 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -107,6 +107,15 @@ class GraduationTasksController < ApplicationController @work_list = @task.graduation_works.where(id: graduation_work_id) end + # 组员、组长作品的筛选 + if @task.task_type == 2 && !params[:member_work].blank? + if params[:member_work].to_i == 1 + @work_list = @work_list.where("user_id = commit_user_id") + elsif params[:member_work].to_i == 0 + @work_list = @work_list.where("user_id != commit_user_id") + end + end + # 输入姓名和学号搜索 # TODO user_extension 如果修改 请调整 unless params[:search].blank? diff --git a/app/views/graduation_tasks/tasks_list.json.jbuilder b/app/views/graduation_tasks/tasks_list.json.jbuilder index 7b189c456..dc09d759e 100644 --- a/app/views/graduation_tasks/tasks_list.json.jbuilder +++ b/app/views/graduation_tasks/tasks_list.json.jbuilder @@ -49,6 +49,7 @@ if @task.published? || @user_course_identity < Course::STUDENT json.class_grouping_name @students.select{|student| student.user_id == work.user_id}.first.try(:course_group_name) json.ultimate_score work.ultimate_score if @task.have_grouping? + json.is_leader work.user_id == work.commit_user_id json.grouping_name work.grouping_name if @task.base_on_project json.project_info project_info work, @current_user, @user_course_identity