public function actionNewnot() { $user_id = Yii::$app->user->identity->id; //$data = Yii::$app->request->post(); //$res = Message::find()->select('status')->where(['`to`' => $data['usid'], '`status`' => 0, '`from`' => $data['frid']])->asArray()->all(); $res = FriendList::find()->select('status')->where(['`to`' => $user_id, '`status`' => 0])->asArray()->all(); $res = count($res); echo $res; }