update 1.0.8.0
Commits for version update
This commit is contained in:
@@ -12,4 +12,27 @@ class Organization extends BaseModel
|
||||
|
||||
/* Define the fillable fields */
|
||||
protected $fillable = ['id', 'name', 'phone', 'website', 'address', 'head', 'internal_notes'];
|
||||
|
||||
public function userRelation()
|
||||
{
|
||||
$related = "App\Model\helpdesk\Agent_panel\User_org";
|
||||
|
||||
return $this->hasMany($related, 'org_id');
|
||||
}
|
||||
|
||||
public function getUserIds()
|
||||
{
|
||||
$user_relations = $this->userRelation()->lists('user_id')->toArray();
|
||||
|
||||
return $user_relations;
|
||||
}
|
||||
|
||||
public function users()
|
||||
{
|
||||
$user = new \App\User();
|
||||
$user_ids = $this->getUserIds();
|
||||
$users = $user->whereIn('id', $user_ids);
|
||||
|
||||
return $users;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user