From 6c656a6bed6932827b257f25795c2bcbb8b680d9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 7 Mar 2020 10:17:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/weapps/attendances_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/weapps/attendances_controller.rb b/app/controllers/weapps/attendances_controller.rb index d584072c2..3f0eec248 100644 --- a/app/controllers/weapps/attendances_controller.rb +++ b/app/controllers/weapps/attendances_controller.rb @@ -27,7 +27,7 @@ class Weapps::AttendancesController < ApplicationController tip_exception(403) if @user_course_identity >= Course::STUDENT current_date = Date.current current_end_time = Time.current.strftime("%H:%M:%S") - @current_attendance = @course.course_attendances.where("attendance_date = '#{current_date}' and end_time > '#{current_end_time}'") + @current_attendance = @course.course_attendances.where("attendance_date > '#{current_date}' or (attendance_date = '#{current_date}' and end_time > '#{current_end_time}')") .order("attendance_date asc, start_time asc") all_attendances = @course.course_attendances.where("attendance_date < '#{current_date}' or (attendance_date = '#{current_date}' and end_time < '#{current_end_time}')")