/**
  * @return \yii\db\ActiveQuery
  */
 public function getDepartment()
 {
     return $this->hasOne(User::className(), ['id' => 'departmentId']);
 }
示例#2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUsers()
 {
     return $this->hasMany(User::className(), ['profileId' => 'id']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUsers()
 {
     return $this->hasMany(User::className(), ['departmentId' => 'id']);
 }