PMC-786
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user