Ejemplo n.º 1
0
 public function run()
 {
     /* @var $groupDs PwUserGroups */
     list($sName, $sUid, $sEmail, $page) = $this->getInput(array('username', 'uid', 'email', 'page'));
     Wind::import('WINDID:service.user.vo.WindidUserSo');
     $vo = new WindidUserSo();
     $sName && $vo->setUsername($sName);
     $sUid && $vo->setUid($sUid);
     $sEmail && $vo->setEmail($sEmail);
     $page = intval($page) == 0 ? 1 : abs(intval($page));
     /* @var $searchDs PwUserSearch */
     $searchDs = Windid::load('user.WindidUser');
     $count = $searchDs->countSearchUser($vo);
     $result = array();
     if (0 < $count) {
         $totalPage = ceil($count / $this->pageNumber);
         $page > $totalPage && ($page = $totalPage);
         list($start, $limit) = Pw::page2limit($page, $this->pageNumber);
         $result = $searchDs->searchUser($vo, $limit, $start);
     }
     $data = $vo->getData();
     $this->setOutput($data, 'args');
     $this->setOutput($page, 'page');
     $this->setOutput($this->pageNumber, 'perPage');
     $this->setOutput($count, 'count');
     $this->setOutput($result, 'list');
 }
Ejemplo n.º 2
0
 public function countSearchUser(WindidUserSo $vo)
 {
     return $this->_getSearchDao()->countSearchUser($vo->getData());
 }