PMCORE-2636

This commit is contained in:
Paula Quispe
2020-12-22 15:21:08 -04:00
parent 1c36a18904
commit 9f77a4d106
5 changed files with 89 additions and 0 deletions

View File

@@ -162,6 +162,8 @@ class Search extends AbstractCases
$query->groupBy('APP_NUMBER');
/** Apply filters */
$this->filters($query);
/** Exclude the web entries does not submitted */
$query->positiveCases($query);
/** Apply order and pagination */
// The order by clause
$query->orderBy($this->getOrderByColumn(), $this->getOrderDirection());

View File

@@ -455,6 +455,18 @@ class Delegation extends Model
return $query->where('APP_DELEGATION.APP_NUMBER', '<=', $to);
}
/**
* Scope for query to get the positive cases for avoid the web entry
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopePositiveCases($query)
{
return $query->where('APP_DELEGATION.APP_NUMBER', '>', 0);
}
/**
* Scope more than one range of cases
*