use last Chore-Log when determining the next assigned person (#933)

This commit is contained in:
fipwmaqzufheoxq92ebc 2020-08-18 19:34:19 +02:00 committed by GitHub
parent 295f360306
commit e7af74f550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();