添加功能

This commit is contained in:
李鹏宇
2026-09-17 11:06:23 +08:00
parent 45c9d9651e
commit f9c439b60a
+2 -6
View File
@@ -265,14 +265,10 @@ class HrLeave(models.Model):
if self.request_hour_from and self.request_hour_to:
start_hour = float(self.request_hour_from)
end_hour = float(self.request_hour_to)
if start_hour == 9 and end_hour == 12:
if start_hour == 9 and end_hour in [13, 14]:
self.leave_hours = 4
else:
leave_hours = end_hour - start_hour
# 跨中午(12:00-13:00 午休),减去1小时
if start_hour < 13 and end_hour > 12:
leave_hours -= 1
self.leave_hours = leave_hours
self.leave_hours = end_hour - start_hour
else:
self.leave_hours = 0