diff --git a/common/models/Customer.php b/common/models/Customer.php index 0954ddc..a784f63 100644 --- a/common/models/Customer.php +++ b/common/models/Customer.php @@ -155,10 +155,10 @@ if (!file_exists(\Yii::getAlias('@storage/customers/'))) { FileHelper::createDirectory(\Yii::getAlias('@storage/customers/')); } - - if ($file->saveAs(\Yii::getAlias('@storage/customers/') . $file->baseName.'_'.Yii::$app->security->generateRandomString(5).'.'.$file->extension)) { - $this->image = '/storage/customers/'.$file->baseName.'_'.Yii::$app->security->generateRandomString(5).'.'.$file->extension; - $this->file->name = $file->baseName.'_'.Yii::$app->security->generateRandomString(5).'.'.$file->extension;; + $filename = $file->baseName.'_'.Yii::$app->security->generateRandomString(5).'.'.$file->extension; + if ($file->saveAs(\Yii::getAlias('@storage/customers/') . $filename)) { + $this->image = '/storage/customers/'.$filename; + $this->file->name = $filename; return true; } return false; diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index abcc9a9..d6b5c9c 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -161,6 +161,7 @@ return $this->redirect(['site/index']); } } + return $this->render('signup', [ 'model' => $model ]); -- libgit2 0.21.4