コード例 #1
0
ファイル: Workplaces.php プロジェクト: Griff19/it_base
 /**
  * @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
ファイル: StoryWorkplace.php プロジェクト: Griff19/it_base
 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
ファイル: Offices.php プロジェクト: ziam767/personal
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEmployees()
 {
     return $this->hasMany(Employees::className(), ['office_id' => 'office_id']);
 }