public function indexAction() { $contractors = new Contract_Models_ContractorMapper(); $errorMsg = null; if($this->getRequest()->isPost()) { $formData = $this->getRequest()->getPost(); $arrayContractors = array(); $key = trim($formData['key']); if($key != null) { $condition = $formData['condition']; $arrayContractors = $contractors->fetchAllJoin($key,$condition); if(count($arrayContractors) == 0) { $errorMsg = General_Models_Text::$text_searchErrorNr; } } else { $errorMsg = General_Models_Text::$text_searchErrorNi; } } else { $arrayContractors = $contractors->fetchAllJoin(); } if(count($arrayContractors) != 0) { $pageNumber = $this->_getParam('page'); $arrayContractors->setCurrentPageNumber($pageNumber); $arrayContractors->setItemCountPerPage('20'); } $this->view->messages = $this->_helper->flashMessenger->getMessages(); $this->view->arrayContractors = $arrayContractors; $this->view->errorMsg = $errorMsg; $this->view->modelName = "承包商信息"; }