From e7af74f55070a4f565a1bdcd58db2de6c5067adc Mon Sep 17 00:00:00 2001 From: fipwmaqzufheoxq92ebc <29818044+fipwmaqzufheoxq92ebc@users.noreply.github.com> Date: Tue, 18 Aug 2020 19:34:19 +0200 Subject: [PATCH] use last Chore-Log when determining the next assigned person (#933) --- services/ChoresService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/ChoresService.php b/services/ChoresService.php index dda04d1a..2af0737c 100644 --- a/services/ChoresService.php +++ b/services/ChoresService.php @@ -133,7 +133,7 @@ class ChoresService extends BaseService $chore = $this->getDatabase()->chores($choreId); $choreLastTrackedTime = $this->getDatabase()->chores_log()->where('chore_id = :1 AND undone = 0', $choreId)->max('tracked_time'); - $lastChoreLogRow = $this->getDatabase()->chores_log()->where('chore_id = :1 AND tracked_time = :2 AND undone = 0', $choreId, $choreLastTrackedTime)->fetch(); + $lastChoreLogRow = $this->getDatabase()->chores_log()->where('chore_id = :1 AND tracked_time = :2 AND undone = 0', $choreId, $choreLastTrackedTime)->orderBy('row_created_timestamp', 'DESC')->fetch(); $lastDoneByUserId = $lastChoreLogRow->done_by_user_id; $users = $this->getUsersService()->GetUsersAsDto();