->orderBy('order ASC') | ->orderBy('order ASC') | ||||
->all(); | ->all(); | ||||
if($model->load(Yii::$app->request->post()) && $model->validate() && $model->save()) | |||||
if($model->load(Yii::$app->request->post()) && $model->validate()) | |||||
{ | { | ||||
$this->redirect(['commandeauto/index']) ; | |||||
if(!strlen($model->date_fin)){ | |||||
$model->date_fin = null ; | |||||
} | |||||
if($model->save()) | |||||
{ | |||||
$this->redirect(['commandeauto/index']) ; | |||||
} | |||||
} | } | ||||
return $this->render('update',[ | return $this->render('update',[ |