feat: handle_date 根据work_time自动处理
This commit is contained in:
parent
982247ee70
commit
00853f395d
|
@ -391,6 +391,13 @@ class MlogSerializer(CustomModelSerializer):
|
|||
if mtask:
|
||||
if mtask.start_date == mtask.end_date:
|
||||
attrs['handle_date'] = mtask.start_date
|
||||
else:
|
||||
if attrs['work_end_time']:
|
||||
attrs['handle_date'] = attrs['work_end_time'].date()
|
||||
elif attrs['work_start_time']:
|
||||
attrs['handle_date'] = attrs['work_start_time'].date()
|
||||
if attrs['handle_date'] >= mtask.start_date and attrs['handle_date'] <= mtask.end_date:
|
||||
pass
|
||||
else:
|
||||
if attrs['handle_date'] >= mtask.start_date and attrs['handle_date'] <= mtask.end_date:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue