This commit is contained in:
Manish Verma
2016-12-13 18:18:25 +05:30
parent fc98add11c
commit 2d8e640e9b
2314 changed files with 97798 additions and 75664 deletions

View File

@@ -12,27 +12,22 @@ class Organization extends BaseModel
/* Define the fillable fields */
protected $fillable = ['id', 'name', 'phone', 'website', 'address', 'head', 'internal_notes'];
public function userRelation()
{
public function userRelation(){
$related = "App\Model\helpdesk\Agent_panel\User_org";
return $this->hasMany($related, 'org_id');
return $this->hasMany($related,'org_id');
}
public function getUserIds()
{
public function getUserIds(){
$user_relations = $this->userRelation()->lists('user_id')->toArray();
return $user_relations;
}
public function users()
{
public function users(){
$user = new \App\User();
$user_ids = $this->getUserIds();
$users = $user->whereIn('id', $user_ids);
$users = $user->whereIn('id',$user_ids);
return $users;
}
}