diff --git a/app/controllers/weapps/attendances_controller.rb b/app/controllers/weapps/attendances_controller.rb index 7da852393..ea2688cc5 100644 --- a/app/controllers/weapps/attendances_controller.rb +++ b/app/controllers/weapps/attendances_controller.rb @@ -130,8 +130,14 @@ class Weapps::AttendancesController < ApplicationController def end a_end_time = "#{@attendance.attendance_date} #{@attendance.end_time}".to_time - tip_exception("该签到已截止") unless @attendance.current_attendance? - @attendance.update!(end_time: Time.current) + tip_exception("该签到已截止") if a_end_time < Time.now + + a_start_time = "#{@attendance.attendance_date} #{@attendance.start_time}".to_time + if a_start_time > Time.now + @attendance.update!(end_time: Time.current, start_time: Time.current) + else + @attendance.update!(end_time: Time.current) + end render_ok end