Merge branch 'dev_chen' into dev_aliyun

courseware
cxt 5 years ago
commit 505d5aeb25

@ -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?
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

Loading…
Cancel
Save