/** * Lists all Notification models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Notification::find()->where(['user_id' => Yii::$app->user->id]), 'sort' => ['defaultOrder' => ['created_at' => SORT_DESC, 'id' => SORT_ASC]]]); $notifyCount = UserService::findNotifyCount(); UserService::clearNotifyCount(); return $this->render('index', ['dataProvider' => $dataProvider, 'notifyCount' => $notifyCount]); }
public function userDoAction($id, $action) { $comment = PostComment::findComment($id); $user = \Yii::$app->user->getIdentity(); if (in_array($action, ['like'])) { return UserService::CommentAction($user, $comment, $action); } }
public function userDoAction($id, $action) { $topic = Topic::findTopic($id); $user = \Yii::$app->user->getIdentity(); if (in_array($action, ['like', 'hate'])) { return UserService::TopicActionA($user, $topic, $action); } else { return UserService::TopicActionB($user, $topic, $action); } }
public function actionUsers() { $model = UserService::findActiveUser(100); $count = User::find()->where(['status' => 10])->count(); return $this->render('users', ['model' => $model, 'count' => $count]); }
public function run() { $notifyCount = UserService::findNotifyCount(); return $this->render('nav', ['notifyCount' => $notifyCount]); }
public function userDoAction($id, $action) { $topic = Tweet::findTweet($id); $user = \Yii::$app->user->getIdentity(); return UserService::TopicActionB($user, $topic, $action); }
public function actionAtUsers() { $model = UserService::findActiveUser(400); return Json::encode(Arr::getColumn($model, 'username')); }