This commit is contained in:
Paula Quispe
2019-05-13 16:44:40 -04:00
parent 4064c1bebf
commit ff33075228
14 changed files with 1655 additions and 303 deletions

View File

@@ -10,5 +10,24 @@ class Groupwf extends Model
protected $primaryKey = 'GRP_ID';
// We do not have create/update timestamps for this table
public $timestamps = false;
/**
* Scope a query to active groups
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeActive($query)
{
return $query->where('GRP_STATUS', '=', 'ACTIVE');
}
/**
* Return the user this belongs to
*/
public function groupUsers()
{
return $this->belongsTo(GroupUser::class, 'GRP_ID', 'GRP_ID');
}
}