PMCORE-3104

This commit is contained in:
Paula Quispe
2021-08-19 15:23:25 -04:00
parent 7cbba5190c
commit f18e475196
17 changed files with 262 additions and 25 deletions

View File

@@ -355,6 +355,24 @@ class Application extends Model
return $query;
}
/**
* Scope the Draft cases
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param string $user
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeDraft($query, $user)
{
// Filter the status draft
$query->statusId(Application::STATUS_DRAFT);
// Filter the creator
$query->creator($user);
return $query;
}
/**
* Get Applications by PRO_UID, ordered by APP_NUMBER.
*