PMCORE-3836

This commit is contained in:
Paula.Quispe
2022-05-16 12:50:20 -04:00
parent c17dc60e24
commit bb60a579e2
3 changed files with 79 additions and 15 deletions

View File

@@ -85,8 +85,13 @@ class Search extends AbstractCases
$query->joinDelegation();
// Add the filter
$query->userId($this->getUserId());
// Get only the open threads related to the user
$query->where('APP_DELEGATION.DEL_THREAD_STATUS', '=', 'OPEN');
// Get only the open threads related to the user or the last index
$query->where(function ($query) {
$query->where('APP_DELEGATION.DEL_THREAD_STATUS', 'OPEN');
$query->orWhere(function ($query) {
$query->where('APP_DELEGATION.DEL_LAST_INDEX', '1');
});
});
}
// Filter by user who started
if ($this->getUserStartedId()) {
@@ -108,8 +113,13 @@ class Search extends AbstractCases
}
// Add the filter
$query->task($this->getTaskId());
// Get only the open threads related to the task
$query->where('APP_DELEGATION.DEL_THREAD_STATUS', '=', 'OPEN');
// Get only the open threads related to the task or the last index
$query->where(function ($query) {
$query->where('APP_DELEGATION.DEL_THREAD_STATUS', 'OPEN');
$query->orWhere(function ($query) {
$query->where('APP_DELEGATION.DEL_LAST_INDEX', '1');
});
});
}
// Specific start case date from
if (!empty($this->getStartCaseFrom())) {