fix: get_total_hour_now exclude 错误

This commit is contained in:
caoqianming 2024-05-07 10:16:22 +08:00
parent 6ee42a6993
commit ce38c3e338
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ def get_total_hour_now(sflogId: str=''):
return sflog.total_hour_now
else:
SfLog.objects.filter(end_time__lte=now).exclude(
total_hour_now__lt=F('total_hour')).update(total_hour_now=F('total_hour'))
total_hour_now=F('total_hour')).update(total_hour_now=F('total_hour'))
sf_qs = SfLog.objects.filter(end_time__gt=now)
for i in sf_qs:
total_hour_now = (now-i.start_time).total_seconds()/3600