Ejemplo n.º 1
0
 /**
  * 根据搜索条件返回检索结果列表
  *
  * @param PwUserBanSo $searchVo
  * @param int $start 开始检索位置
  * @param int $limit 返回条数
  * @return array
  */
 public function searchBanInfo(PwUserBanSo $searchVo, $limit = 10, $start = 0)
 {
     return $this->_getDao()->fetchBanInfoByCondition($searchVo->getData(), $limit, $start);
 }
Ejemplo n.º 2
0
 /**
  * 获得列表
  */
 public function listAction()
 {
     Wind::import('SRV:user.vo.PwUserBanSo');
     $page = intval($this->getInput('page'));
     $perpage = 10;
     $page <= 0 && ($page = 1);
     $searchSo = new PwUserBanSo();
     $searchSo->setType($this->getInput('key'))->setKeywords($this->getInput('value'))->setCreatedUsername($this->getInput('operator'))->setStartTime($this->getInput('start_time'))->setEndTime($this->getInput('end_time'));
     $result = array();
     /* @var $banDs PwUserBan */
     $banDs = Wekit::load('user.PwUserBan');
     $count = $banDs->countWithCondition($searchSo);
     if ($count > 0) {
         $totalPage = ceil($count / $perpage);
         $page > $totalPage && ($page = $totalPage);
         $num = $num <= 0 ? 10 : $num;
         list($start, $limit) = Pw::page2limit($page, $perpage);
         $result = $this->_getService()->searchBanInfo($searchSo, $limit, $start);
     }
     $this->setOutput($result, 'list');
     $this->setOutput($count, 'count');
     $this->setOutput($searchSo, 'searchSo');
     $this->setOutput($page, 'page');
     $this->setOutput($perpage, 'perpage');
     $this->setOutput($searchSo->getArgsUrl(), 'urlArgs');
 }