是否选题

dev_course
daiao 6 years ago
parent 281417e6b2
commit 2aaa0fe652

@ -24,8 +24,7 @@ class GraduationTopicsController < ApplicationController
end
# 当前用户是否已经选过题
# @user_selected = StudentGraduationTopic.where(graduation_topic_id: @graduation_topic, user_id: current_user.id).count > 0
user_graduation_topics = @course.student_graduation_topics.where(user_id: current_user.id, status: [0, 1], graduation_topic_id: @graduation_topic.pluck(:id)) #6.12 -hs
user_graduation_topics = @course.student_graduation_topics.where(user_id: current_user.id, status: [0, 1]) #6.12 -hs
@user_selected = user_graduation_topics.size > 0
## 分页参数
page = params[:page] || 1

Loading…
Cancel
Save