fix: get_total_hour_now exclude 错误
This commit is contained in:
parent
6ee42a6993
commit
ce38c3e338
|
|
@ -49,7 +49,7 @@ def get_total_hour_now(sflogId: str=''):
|
||||||
return sflog.total_hour_now
|
return sflog.total_hour_now
|
||||||
else:
|
else:
|
||||||
SfLog.objects.filter(end_time__lte=now).exclude(
|
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)
|
sf_qs = SfLog.objects.filter(end_time__gt=now)
|
||||||
for i in sf_qs:
|
for i in sf_qs:
|
||||||
total_hour_now = (now-i.start_time).total_seconds()/3600
|
total_hour_now = (now-i.start_time).total_seconds()/3600
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue