dev_forum
SylorHuang 5 years ago
parent 61747f8e84
commit 50c7e9815e

@ -953,12 +953,14 @@ class PollsController < ApplicationController
@poll_publish_count = get_user_permission_course(poll_ids,2).count @poll_publish_count = get_user_permission_course(poll_ids,2).count
@poll_unpublish_count = get_user_permission_course(poll_ids,1).count @poll_unpublish_count = get_user_permission_course(poll_ids,1).count
@course_all_members = @course.students @course_all_members = @course.students
logger.info("#######F___________poll_user_ids________________####{@poll.poll_users.pluck(:id)}")
@poll_group_counts = @course.course_groups_count @poll_group_counts = @course.course_groups_count
if @user_course_identity < Course::STUDENT #当前为老师,而且老师只能查看自己班级的/课堂的问卷 if @user_course_identity < Course::STUDENT #当前为老师,而且老师只能查看自己班级的/课堂的问卷
@poll_current_user_status = 0 @poll_current_user_status = 0
@poll_users_list = @poll.all_poll_users(current_user.id).distinct #该老师分班的全部学生 @poll_users_list = @poll.all_poll_users(current_user.id) #该老师分班的全部学生
get_poll_answers(@poll_users_list) get_poll_answers(@poll_users_list)
logger.info("#######F__________@poll_users_list________________####{@poll_users_list.pluck(:id)}")
if @poll_list_status == 1 if @poll_list_status == 1
@poll_course_groups =[] @poll_course_groups =[]
@ -1026,9 +1028,7 @@ class PollsController < ApplicationController
#搜索 #搜索
if search_content.present? if search_content.present?
@poll_users_list = @poll_users_list.joins(user: :user_extension).where("CONCAT(lastname, firstname) like ? OR student_id like ?", "%#{search_content}%", "%#{search_content}%") @poll_users_list = @poll_users_list.joins(user: :user_extension).where("CONCAT(lastname, firstname) like ? OR student_id like ?", "%#{search_content}%", "%#{search_content}%")
end end
@poll_users_size = @poll_users_list.count @poll_users_size = @poll_users_list.count

Loading…
Cancel
Save