dev_forum
SylorHuang 5 years ago
parent 3c8fc504c6
commit 857f2dcb3e

@ -1238,7 +1238,7 @@ class ExercisesController < ApplicationController
@teacher_unreview_count = 0 @teacher_unreview_count = 0
#筛选/分类,排序 #筛选/分类,排序
order = params[:order] order = params[:order]
if @exercise_users_list.present? && @exercise_users_list.count > 0 if @exercise_users_list.present? && @exercise_users_list.size > 0
teacher_reviews = @exercise_users_list.exercise_review teacher_reviews = @exercise_users_list.exercise_review
teacher_unreviews = @exercise_users_list.exercise_unreview teacher_unreviews = @exercise_users_list.exercise_unreview
@teacher_review_count = teacher_reviews.count #已评阅 @teacher_review_count = teacher_reviews.count #已评阅

@ -953,17 +953,12 @@ 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) #该老师分班的全部学生 @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)}")
logger.info("#######F__________@users_ids________________####{PollUser.where(id:@poll_users_list.pluck(:id)).pluck(:user_id)}")
if @poll_list_status == 1 if @poll_list_status == 1
@poll_course_groups =[] @poll_course_groups =[]
else else
@ -1033,15 +1028,15 @@ class PollsController < ApplicationController
@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
logger.info("#######F_______@poll_users_list_last___@users_ids________________####{@poll_users_list.pluck(:id)}") logger.info("#######F_______@poll_users_list_last___@users_ids________________####{@poll_users_list.pluck(:user_id)}")
@poll_users_size = @poll_users_list.count @poll_users_size = @poll_users_list.count
# 分页 # 分页
page = params[:page] || 1 page = params[:page] || 1
limit = params[:limit] || 20 limit = params[:limit] || 20
@poll_users_list = @poll_users_list.page(page).per(limit) @poll_users_list = @poll_users_list.page(page).per(limit)
logger.info("#######F_______@poll_users_list_after_page___@users_ids________________####{@poll_users_list.pluck(:id)}") logger.info("#######F_______@poll_users_list_after_page___@users_ids________________####{@poll_users_list.pluck(:user_id)}")
else else
@poll_users_list = [] @poll_users_list = []
@poll_users_size = 0 @poll_users_size = 0

Loading…
Cancel
Save