Exemplo n.º 1
0
 /**
  * 	用户管理分页
  */
 public function actionUserpagechange()
 {
     $page = $_GET['page'];
     $usertb = new UserTb();
     $allpage = $usertb->userallpage(6);
     if ($allpage < $page || $page < 1) {
         $result = '{"success":false,"allPage":1,"msg":"页码出错"}';
     } else {
         $result = $usertb->getPageUserWithOrder($page, 6);
         $result = '{"success":true,"users":' . json_encode($result, JSON_UNESCAPED_UNICODE) . ',"allPage":"' . $allpage . '"}';
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  * 获取用户列表
  */
 public function actionGetuserdata()
 {
     $rightNowUserId = Yii::$app->user->identity->XH_ID;
     $rightNowUserName = Yii::$app->user->identity->Name;
     $usertb = new UserTb();
     $result = $usertb->getPageUserWithOrder(1, 6);
     $allpage = $usertb->userallpage(6);
     if (empty($result)) {
         $result = '{"success":false,"msg":"获取失败","users":' . json_encode($result, JSON_UNESCAPED_UNICODE) . ',"userIdNow":"' . $rightNowUserId . '","userName":"******"}';
     } else {
         $result = '{"success":true,"allPage":"' . $allpage . '","users":' . json_encode($result, JSON_UNESCAPED_UNICODE) . ',"userIdNow":"' . $rightNowUserId . '","userName":"******"}';
     }
     echo $result;
 }