public function actionUpdate($id)
{
$model = Store::findOne($id);
if (!$model) {
throw new NotFoundHttpException('未找到该营业点。');
}
if ($model->load(Yii::$app->request->post())) {
if ($model->save()) {
Yii::$app->session->setFlash('success', '成功更新营业点“' . $model->name . '”。');
return $this->refresh();
} else {
Yii::$app->session->setFlash('danger', '更新营业点失败。');
}
}
return $this->render('form', ['model' => $model]);
}