예제 #1
0
 /**
  * @return $this
  */
 public function getOwner()
 {
     $res = $this->hasMany(Employees::className(), ['id' => 'employee_id'])->viaTable('wp_owners', ['workplace_id' => 'id']);
     //var_dump($res);
     return $res;
 }
예제 #2
0
 public function getEmployee()
 {
     return $this->hasOne(Employees::className(), ['id' => 'id_employee']);
 }
예제 #3
0
파일: Devices.php 프로젝트: Griff19/it_base
 public function getEmployee()
 {
     return $this->hasOne(Employees::className(), ['id' => 'employee_id'])->viaTable('wp_owners', ['workplace_id' => 'workplace_id']);
 }
예제 #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEmployees()
 {
     return $this->hasMany(Employees::className(), ['office_id' => 'office_id']);
 }