public function searchAction()
 {
     list($keyword, $type, $ischeckAll, $page, $perpage) = $this->getInput(array('keyword', 'type', '_check', 'page', 'perpage'));
     $page < 1 && ($page = 1);
     $perpage = $perpage ? $perpage : 20;
     list($offset, $limit) = Pw::page2limit($page, $perpage);
     Wind::import('SRV:word.vo.PwWordSo');
     $wordSo = new PwWordSo();
     /* @var $wordSo PwWordSo */
     $keyword && $wordSo->setWord($keyword);
     $type > 0 && $wordSo->setWordType($type);
     $total = $this->_getWordDS()->countSearchWord($wordSo);
     $wordList = $total ? $this->_getWordDS()->searchWord($wordSo, $limit, $offset) : array();
     $this->setOutput($total, 'total');
     $this->setOutput($wordList, 'wordList');
     $this->setOutput($this->_getWordDS()->getTypeMap(), 'typeList');
     $this->setOutput(Wekit::C($this->_configName), 'config');
     $this->setOutput($page, 'page');
     $this->setOutput('search', 'action');
     $this->setOutput($perpage, 'perpage');
     $this->setOutput($ischeckAll, 'ischeckAll');
     $this->setOutput(array('keyword' => $keyword, 'type' => $type, '_check' => $ischeckAll, 'perpage' => $perpage), 'args');
     $this->setTemplate('manage_run');
 }
Example #2
0
 /**
  * 仅服务搜索
  *
  * @param PwWordSo $so
  * @return array
  */
 public function searchWord(PwWordSo $so, $limit = 20, $offset = 0)
 {
     return $this->_getDao()->searchWord($so->getData(), $limit, $offset);
 }