|
|
@ -130,8 +130,14 @@ class Weapps::AttendancesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
def end
|
|
|
|
def end
|
|
|
|
a_end_time = "#{@attendance.attendance_date} #{@attendance.end_time}".to_time
|
|
|
|
a_end_time = "#{@attendance.attendance_date} #{@attendance.end_time}".to_time
|
|
|
|
tip_exception("该签到已截止") unless @attendance.current_attendance?
|
|
|
|
tip_exception("该签到已截止") if a_end_time < Time.now
|
|
|
|
@attendance.update!(end_time: Time.current)
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
render_ok
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|