fix: get_total_hour_now sql查询bug

This commit is contained in:
caoqianming 2023-07-31 17:46:56 +08:00
parent 8e3802966e
commit a29ed1edc8
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,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=12).update(total_hour_now=12)
sf_qs = SfLog.objects.filter(end_time_gt=now)
sf_qs = SfLog.objects.filter(end_time__gt=now)
for i in sf_qs:
i.total_hour_now = (now-localtime(i.start_time)).total_seconds/3600
i.save()