PMCORE-3553

This commit is contained in:
Paula Quispe
2021-12-03 18:37:03 -04:00
parent 5c4787ac20
commit 1a48d77c96
5 changed files with 19 additions and 8 deletions

View File

@@ -68,7 +68,7 @@ class Participated extends AbstractCases
// Specific case title
if (!empty($this->getCaseTitle())) {
// Get the result
$result = Delegation::casesThreadTitle($this->getCaseTitle(), $this->getOffset(), $this->getLimit());
$result = Delegation::casesThreadTitle($this->getCaseTitle());
// Add the filter
$query->specificCases($result);
}

View File

@@ -66,7 +66,7 @@ class Supervising extends AbstractCases
// Specific case title
if (!empty($this->getCaseTitle())) {
// Get the result
$result = Delegation::casesThreadTitle($this->getCaseTitle(), $this->getOffset(), $this->getLimit());
$result = Delegation::casesThreadTitle($this->getCaseTitle());
// Add the filter
$query->specificCases($result);
}

View File

@@ -2181,12 +2181,10 @@ class Delegation extends Model
* Get cases filter by thread title
*
* @param string $search
* @param int $offset
* @param int $limit
*
* @return array
*/
public static function casesThreadTitle(string $search, int $offset = 0, int $limit = 15)
public static function casesThreadTitle(string $search)
{
// Get the case numbers related to this filter
$query = Delegation::query()->select(['APP_NUMBER']);
@@ -2194,8 +2192,6 @@ class Delegation extends Model
$query->title($search);
// Group by
$query->groupBy('APP_NUMBER');
// Apply the limit
$query->offset($offset)->limit($limit);
// Get the result
$results = $query->get();