public function getStaffs() { return $this->hasMany(MStaff::className(), ['gh_id' => 'gh_id']); }
public function getStaff() { return $this->hasOne(MStaff::className(), ['staff_id' => 'staff_id']); }
public function getSceneStaff() { if ($this->scene_pid == 0) { return null; } return $this->hasOne(MStaff::className(), ['gh_id' => 'gh_id', 'scene_id' => 'scene_pid']); }
public function getStaff() { return $this->hasOne(MStaff::className(), ['gh_id' => 'gh_id', 'scene_id' => 'scene_id']); }
public function getSupervisor() { if ($this->is_selfOperated) { return $this->hasOne(MStaff::className(), ['name' => 'manager', 'mobile' => 'mobile', 'gh_id' => 'gh_id']); } else { return $this->hasOne(MStaff::className(), ['staff_id' => 'staff_id'])->viaTable('wx_rel_supervision_staff_office', ['office_id' => 'office_id']); } }