上下班打卡记录bug

This commit is contained in:
曹前明 2022-08-24 10:42:54 +08:00
parent 1c5e7f3366
commit 890f17c0d0
1 changed files with 4 additions and 4 deletions

View File

@ -217,8 +217,8 @@ class HrmService:
cr_10 = ClockRecord.objects.filter(
type=10, employee=ep, create_time__year=now.year, create_time__month=now.month, create_time__day=now.day).first()
if cr_10:
if now < cr_10.create_by:
cr_10.create_by = now
if now < cr_10.create_time:
cr_10.create_time = now
cr_10.trigger = 'door'
cr_10.detail = data['info']['extend']
cr_10.save()
@ -243,8 +243,8 @@ class HrmService:
cr_20 = ClockRecord.objects.filter(
type=20, employee=ep, create_time__year=now.year, create_time__month=now.month, create_time__day=now.day).first()
if cr_20:
if now > cr_20.create_by:
cr_20.create_by = now
if now > cr_20.create_time:
cr_20.create_time = now
cr_20.trigger = 'door'
cr_20.detail = data['info']['extend']
cr_20.save()