mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
auto calculating tracked_time and estimated_time both for master and sub task
This commit is contained in:
1 parent
ef2ab75ce4
commit
ae900e24c0
7 files changed
+104
-34
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user