diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index d9338256..0b5e9252 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -1940,6 +1940,28 @@ class DataController extends Zend_Controller_Action public function jsonexit($data){ $this->getResponse()->setHeader('Content-Type', 'application/json')->appendBody(json_encode($data,JSON_NUMERIC_CHECK)); return true; - } + } + function organizationAction() + { + $page = $this->_request->getParam('page'); + $name = $this->_request->getParam('name'); + $state=$this->db->query("select distinct responsible.organisation from responsible left join role on role.resid=responsible.id where role.role in ('pointOfContact','resourceProvider','owner')"); + $this->view->organisation=$state->fetchAll(); + if (!empty($name)) { + $this->view->codename=$name; + $sql="select distinct m.* from normalmetadata m left join role r on m.uuid=r.uuid left join responsible s on r.resid=s.id where r.role in ('pointOfContact','resourceProvider','owner') and s.organisation=?"; + $sth = $this->db->prepare($sql); + $sth->execute(array($name)); + $rows = $sth->fetchAll(); + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(10); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + } else { + //提供全部分类列表 + } + } } diff --git a/application/default/views/scripts/data/index.phtml b/application/default/views/scripts/data/index.phtml index 62cf3642..98b26486 100755 --- a/application/default/views/scripts/data/index.phtml +++ b/application/default/views/scripts/data/index.phtml @@ -38,8 +38,8 @@ $this->headTitle()->setSeparator(' - ');
各类社会经济数据。