Authored by wuxiao

修复跳转问题

... ... @@ -157,14 +157,13 @@ class LiveController extends BaseController
$post = Yii::$app->getRequest()->post();
$post['starting_time'] = !$post['starting_time'] ? : strtotime($post['starting_time']);
$model->setAttributes($post);
$model->save();
if ($model->save()){
Yii::$app->session->setFlash('success', '创建成功。');
}else{
Yii::$app->session->setFlash('error', '创建失败。');
}
$this->redirect('/live/room');
return $this->redirect('/live/room');
}
return $this->render('roomedit',[
... ... @@ -189,13 +188,14 @@ class LiveController extends BaseController
$post = Yii::$app->getRequest()->post();
$post['starting_time'] = !$post['starting_time'] ? : strtotime($post['starting_time']);
$model->setAttributes($post);
Yii::$app->session->setFlash('success', '编辑成功。');
if ($model->save()){
Yii::$app->session->setFlash('success', '编辑成功。');
}else{
Yii::$app->session->setFlash('error', '编辑失败。');
}
$this->redirect('/live/room');
return $this->redirect('/live/room');
}
return $this->render('roomedit',[
... ...