/** * Overview of all messages * Used by MailNotificationWidget to display all recent messages */ public function actionNotificationList() { $query = UserMessage::find(); $query->joinWith('message'); $query->where(['user_message.user_id' => Yii::$app->user->id]); $query->orderBy('message.updated_at DESC'); $query->limit(5); return $this->renderAjax('notificationList', array('userMessages' => $query->all())); }