diff --git a/common/models/UserInfo.php b/common/models/UserInfo.php index a6f00fd..e00b6d5 100755 --- a/common/models/UserInfo.php +++ b/common/models/UserInfo.php @@ -81,7 +81,6 @@ return [ [ [ - 'city', 'email', ], 'required', diff --git a/frontend/controllers/ChatController.php b/frontend/controllers/ChatController.php index 45a82ce..2662f1e 100755 --- a/frontend/controllers/ChatController.php +++ b/frontend/controllers/ChatController.php @@ -39,9 +39,18 @@ class ChatController extends Controller public function actionList() { + $user = \Yii::$app->user->identity; + $chat = Chat::find() + ->where([ + 'or', + ['from_user' => $user->id,], + ['to_user' => $user->id,], + ]) + + ->with('messages.user'); $chat = new ActiveDataProvider([ - 'query' => Chat::find(), + 'query' => $chat, 'pagination' => [ 'pageSize' => 5, ], diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 8ebc610..5ae6195 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -286,10 +286,12 @@ class SiteController extends Controller } if (Yii::$app->getUser()->login($user)) { + return $this->redirect('/accounts'); } } } + $model = new SignupForm(); return $this->render('registration', [ 'model' => $model, diff --git a/frontend/views/site/registration.php b/frontend/views/site/registration.php index 507ec55..a21d3f3 100644 --- a/frontend/views/site/registration.php +++ b/frontend/views/site/registration.php @@ -4,7 +4,8 @@ * @var $user_info common\models\UserInfo */ use yii\captcha\Captcha; - use yii\widgets\ActiveForm; +use yii\web\View; +use yii\widgets\ActiveForm; use kartik\select2\Select2; use yii\web\JsExpression; @@ -167,33 +168,50 @@ - \ No newline at end of file -- libgit2 0.21.4