where(['group_id'=>$group])->select(); }else{ return $this->all(); } } public function groupinfo(){ return $this->belongsTo('Groups','group_id','id'); } }