/**
  * 分页
  * @return string
  */
 public function actionPagechange()
 {
     $page = $_POST['page'];
     $moment = new Moments();
     $result = $moment->getPageMomentWithOrder($page, 6);
     $allPage = $moment->getAllPage(6);
     if ($result == false) {
         return '{"success":false}';
     } else {
         $result = '{"success":true,"moments":' . json_encode($result, JSON_UNESCAPED_UNICODE) . ',"allPage":"' . $allPage . '"}';
         echo $result;
     }
 }
 public function actionMomentsshow()
 {
     $rightNowUserId = Yii::$app->user->identity->XH_ID;
     $rightNowUserName = Yii::$app->user->identity->Name;
     $moments = new Moments();
     $result = $moments->getPageMomentWithOrder(1, 20);
     $msg = '';
     foreach ($result as $key => $value) {
         if ($key != 0) {
             $msg .= '<div class=\\"moment_Sty\\"><div class=\\"moment_Owner\\"><p class=\\"centerMomentName\\">' . $value['username'] . '</p></div><div class=\\"moment_Content\\"><p class=\\"centerMomentName\\">' . $value['Content'] . '</p></div><div class=\\"moment_Date\\"><p class=\\"centerMomentName\\">' . $value['Mdate'] . '</p></div></div>';
         }
     }
     if ($msg) {
         echo '{"success" :true , "msg":"' . $msg . '","userIdNow":"' . $rightNowUserId . '","userName":"******"}';
     } else {
         echo '{"success" :false , "msg":"没有动态","userIdNow":"' . $rightNowUserId . '","userName":"******"}';
     }
 }