auto calculating tracked_time and estimated_time both for master and sub task

This commit is contained in:
StudioTem committed 2023-02-14 11:17:40 +01:00
1 parent ef2ab75ce4
commit ae900e24c0
7 files changed
+104 -34

No files matched your search

+8 -2
View File
@@ -46,8 +46,11 @@ class SubTask extends Model
$item['user_id'] = $item['employee_id'];
unset($item['employee_id']);
$item['sub_task_id'] = $this->id;
$item['created_at'] = Carbon::now();
$item['updated_at'] = Carbon::now();
if (!$this->id) {
$item['created_at'] = Carbon::now();
$item['updated_at'] = Carbon::now();
}
return $item;
}, $timesheets);
@@ -55,6 +58,9 @@ class SubTask extends Model
$this->timesheets()->whereNotIn('id', collect($timesheets)->pluck('id')->filter())->delete();
$this->timesheets()->upsert($timesheets, ['id']);
// kedze updatujem cez upsert, tak sa neaktualizuje updated_at. preto ho musim updatnut manualne
$this->touch();
}
public function syncTimeblocks(Array $timeblocks)