|
|
|
@ -16,7 +16,7 @@ class Weapps::CoursesController < Weapps::BaseController
|
|
|
|
|
current_date = Date.current
|
|
|
|
|
current_end_time = Time.current.strftime("%H:%M:%S")
|
|
|
|
|
if @user_course_identity == Course::STUDENT
|
|
|
|
|
attendances = attendances.joins(:course_attendance_groups).where(course_attendance_groups: {course_group_id: member.try(:course_group_id).to_i})
|
|
|
|
|
attendances = attendances.joins(:course_attendance_groups).where(course_attendance_groups: {course_group_id: [member.try(:course_group_id).to_i, 0]})
|
|
|
|
|
.where("attendance_date < '#{current_date}' or (attendance_date = '#{current_date}' and start_time < '#{current_end_time}')")
|
|
|
|
|
end
|
|
|
|
|
attendance_ids = attendances.blank? ? "(-1)" : "(" + attendances.pluck(:id).join(",") + ")"
|
|
|
|
|