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:
|
||||||
if mtask.start_date == mtask.end_date:
|
if mtask.start_date == mtask.end_date:
|
||||||
attrs['handle_date'] = mtask.start_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:
|
else:
|
||||||
if attrs['handle_date'] >= mtask.start_date and attrs['handle_date'] <= mtask.end_date:
|
if attrs['handle_date'] >= mtask.start_date and attrs['handle_date'] <= mtask.end_date:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue