Optimized chore on-time tracking (closes #2385)

This commit is contained in:
Bernd Bestel
2025-01-14 20:39:07 +01:00
parent 9cac3b2311
commit 97dbd7bf08
7 changed files with 51 additions and 17 deletions

View File

@@ -187,11 +187,13 @@ class ChoresService extends BaseService
}
}
$scheduledExecutionTime = $this->getDatabase()->chores_current()->where('chore_id = :1', $chore->id)->fetch()->next_estimated_execution_time;
$logRow = $this->getDatabase()->chores_log()->createRow([
'chore_id' => $choreId,
'tracked_time' => $trackedTime,
'done_by_user_id' => $doneBy,
'skipped' => BoolToInt($skipped)
'skipped' => BoolToInt($skipped),
'scheduled_execution_time' => $scheduledExecutionTime
]);
$logRow->save();
$lastInsertId = $this->getDatabase()->lastInsertId();