选题详情判断用户是否选择了其他选题

dev_course
daiao 6 years ago
parent fd1c376886
commit 82cc18596c

@ -45,6 +45,10 @@ class GraduationTopicsController < ApplicationController
end
## 分页参数
@current_user = current_user
user_graduation_topics = @course.student_graduation_topics.where(user_id: current_user.id,
status: [0, 1],
graduation_topic_id: @graduation_topic.pluck(:id))
@user_selected = user_graduation_topics.size > 0
page = params[:page] || 1
limit = params[:limit] || 50
@users_count = @student_graduation_topics.try(:count).to_i

@ -8,6 +8,7 @@ json.users_count @users_count
json.course_identity @current_user.course_identity(@course)
json.user_selected_topic @graduation_topic.user_status(current_user.id)
json.group_list @course.teacher_group(current_user.id)
json.user_selected @user_selected
# 列表数据
json.users_list do

Loading…
Cancel
Save