/**
  * @return \yii\db\ActiveQuery
  */
 public function getSpecType()
 {
     return $this->hasOne(SpecialistType::className(), ['id' => 'spec_type_id']);
 }
예제 #2
0
 /**
  * Извлекаем список профессий специалистов
  */
 public function getSpecType()
 {
     $query = $this->hasMany(SpecialistType::className(), ['id' => 'spec_type_id'])->viaTable('tbl_specialist_has_type', ['spec_id' => 'specialist_id']);
     if (is_numeric(Yii::$app->request->get('spec_type'))) {
         $query->where(['tbl_specialist_type.id' => (int) Yii::$app->request->get('spec_type')]);
     }
     return $query;
 }
예제 #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSpecTypes()
 {
     return $this->hasMany(SpecialistType::className(), ['id' => 'spec_type_id'])->viaTable('tbl_specialist_has_type', ['spec_id' => 'id']);
 }