add company

This commit is contained in:
king199025
2018-10-11 17:24:47 +03:00
parent 3e10a51c3a
commit 5e2bc02bb5
21 changed files with 720 additions and 10 deletions

View File

@ -68,7 +68,9 @@ class StatusController extends Controller
$model = new Status();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
Yii::$app->session->addFlash('success', 'Статус добавлен');
return $this->redirect(['index']);
}
return $this->render('create', [
@ -88,7 +90,8 @@ class StatusController extends Controller
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
Yii::$app->session->addFlash('success', 'Статус обновлен');
return $this->redirect(['index']);
}
$model->use = ArrayHelper::getColumn(
\common\models\UseStatus::find()->where(['status_id' => $model->id])->asArray()->all(),