diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index e7affe15..8b5e4ead 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -546,7 +546,7 @@ class DataController extends Zend_Controller_Action $this->view->metadata->description=$wiki->parseTable($this->view->escape($row->description)); //处理外部链接 $this->view->metadata->description=preg_replace('/\[\s*(http:\/\/.+?)\s+(.*?)\]/m','$2',$this->view->metadata->description); - $this->view->thumburl='/gndata/'.sprintf('%05d',floor(($row->gid+0.1)/100)*100).'-'.sprintf('%05d',ceil(($row->gid+0.1)/100)*100-1)."/".$row->gid; + $this->view->thumburl='/gndata/'.sprintf('%05d',floor(($row->gid+0.1)/100)*100).'-'.sprintf('%05d',ceil(($row->gid+0.1)/100)*100-1)."/".$row->gid; $this->view->thumburl.='/public/'.str_replace('_s.','.',$row->filename); if (is_numeric($row->projection)) { @@ -621,6 +621,7 @@ class DataController extends Zend_Controller_Action $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $uuid = $this->_request->getParam('uuid'); + $sql="select m.id from normalmetadata m left join mdstatus s on m.uuid=s.uuid left join thumbnail t on t.id=m.id left join geonetworkmetadata g on m.uuid=g.uuid where "; $where=$this->db->quoteInto('m.uuid = ?',$uuid); @@ -628,8 +629,9 @@ class DataController extends Zend_Controller_Action $row=$this->db->fetchRow($sql); if (!$row) exit("读取信息错误"); $id=$row['id']; + //相关元数据,根据同名关键词实现 - $sql="select distinct(md.uuid),md.title from keyword kw left join normalmetadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>? limit 10"; + $sql="select distinct(md.uuid),md.title from keyword kw left join normalmetadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>?"; $rows=$this->db->fetchAll($sql,array($id,$id)); $paginator = Zend_Paginator::factory($rows);