diff --git a/application/default/controllers/HiwaterController.php b/application/default/controllers/HiwaterController.php index 24435780..71f65910 100644 --- a/application/default/controllers/HiwaterController.php +++ b/application/default/controllers/HiwaterController.php @@ -29,13 +29,18 @@ class HiwaterController extends DataController { $this->view->pageIn = "collapse5"; } + else if(in_array($acName,array("mso","cosmos","tdp","isotope"))) + { + $this->view->pageIn = "collapse6"; + } + else if(in_array($acName,array("browse","thumb","fund","tag","timeline","timemap",'author','organization'))) { $this->view->pageIn = "collapse10"; } else if(in_array($acName,array("other"))) { - $this->view->pageIn = "collapse6"; + $this->view->pageIn = "collapse9"; } $this->view->pageID = "hiwater-".$acName; } @@ -97,32 +102,32 @@ class HiwaterController extends DataController function aviationAction() { - $this->getmd(array('航空遥感','WiDAS','PLMR','Lidar','CASI','热红外高光谱数据')); + $this->getmdlimited(array('WiDAS','PLMR','Lidar','CASI','热红外高光谱数据'),'航空遥感'); $this->_helper->viewRenderer('base'); } function radiometerAction() { - $this->getmd(array('','PLMR')); + $this->getmdlimited('PLMR','航空遥感'); $this->_helper->viewRenderer('base'); } function lidarAction() { - $this->getmd(array('LIDAR','Lidar')); + $this->getmdlimited('激光雷达','航空遥感'); $this->_helper->viewRenderer('base'); } function widasAction() - { - $this->getmd(array('WIDAS','WiDAS')); + { + $this->getmdlimited('WIDAS','航空遥感'); $this->_helper->viewRenderer('base'); } function nearvisAction() - { - $this->getmd(array('','CASI')); + { + $this->getmdlimited('CASI','航空遥感'); $this->_helper->viewRenderer('base'); } function thermalAction() - { - $this->getmd(array('','热红外高光谱数据')); + { + $this->getmdlimited('热红外高光谱数据','航空遥感'); $this->_helper->viewRenderer('base'); } @@ -236,7 +241,7 @@ class HiwaterController extends DataController } function bnulaiAction() { - $this->getmd(array('','BNULAI')); + $this->getmd(array('','LAI')); $this->_helper->viewRenderer('base'); } @@ -270,7 +275,31 @@ class HiwaterController extends DataController { $this->getmd('试验','theme'); } + + function msoAction() + { + $this->getmd(array('稳定同位素观测系统','热扩散液流计(TDP)','宇宙射线土壤水分')); + $this->_helper->viewRenderer('base'); + } + function isotopeAction() + { + $this->getmd(array('','稳定同位素观测系统')); + $this->_helper->viewRenderer('base'); + } + + function tdpAction() + { + $this->getmd(array('','热扩散液流计(TDP)')); + $this->_helper->viewRenderer('base'); + } + + function cosmosAction() + { + $this->getmd(array('','宇宙射线土壤水分')); + $this->_helper->viewRenderer('base'); + } + function listAction() { $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') order by timebegin,title"; @@ -412,6 +441,37 @@ class HiwaterController extends DataController $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); $this->view->page=new Pagination($sum,$page,$this->limit); $this->view->offset=$offset+1; + } + + //获取多项条件并列关系的数据并必须满足limited条件 + //$keyword:字符串或字符串数组 + //$limited:限制字符串 + private function getmdlimited($keyword,$limited) + { + $page=(int)$this->_request->getParam('page'); + if (empty($page)) $page=1; + $offset=$this->limit*($page-1); + if (!is_array($keyword)) + { + $keyword=array($keyword); + } + $key="("; + foreach($keyword as $k) + { + $key.="'".$k."',"; + } + $key=substr($key,0,-1); + $key.=")"; + $keyword=$key; + + $state=$this->db->query("select count(m.*) from normalmetadata m left join datasource d on m.uuid=d.uuid left join source s on d.sourceid=s.id where s.code='hiwater' and m.id in (select id from keyword where keyword='".$limited."') and m.id in (select id from keyword where keyword in ".$keyword.")"); + $row=$state->fetchAll(); + $sum=$row[0]['count']; + //@todo: add order with title + $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') and id in (select id from keyword where keyword='".$limited."') and id in (select id from keyword where keyword in ".$keyword.") order by timebegin,title limit ? offset ?"; + $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); + $this->view->page=new Pagination($sum,$page,$this->limit); + $this->view->offset=$offset+1; } //基于数据作者的浏览(包括认证后的数据作者以及未认证的数据作者) diff --git a/application/default/views/scripts/hiwater/navi.phtml b/application/default/views/scripts/hiwater/navi.phtml index d25cf67b..dfdd21c8 100644 --- a/application/default/views/scripts/hiwater/navi.phtml +++ b/application/default/views/scripts/hiwater/navi.phtml @@ -25,7 +25,8 @@ - + +
- + + + + + - +