class Zakaz extends ActiveRecord
{
public function getOtdel()
{
return $this->hasOne(Otdel::className(), ['id_sotrud' => 'id']);
}
}
$model = new LoginForm($id);
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->redirect(['frontend\controllers\ZakazController', 'id'=>$id]);
} else {
return $this->render('login', [
'model' => $model,
]);
}
return $this->redirect('controller/zakaz');
class Zakaz extends \yii\db\ActiveRecord
{
public function getIdSotrud()
{
return $this->hasOne(Otdel::className(), ['id_sotr' => 'id_sotrud']);
}
}