heihe view相关数据sql语句修改,整理代码样式

This commit is contained in:
Li Jianxuan 2011-11-24 07:53:13 +00:00
parent 72c8622ed7
commit 54fb11683b
1 changed files with 4 additions and 2 deletions

View File

@ -621,6 +621,7 @@ class DataController extends Zend_Controller_Action
$this->_helper->layout->disableLayout(); $this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(); $this->_helper->viewRenderer->setNoRender();
$uuid = $this->_request->getParam('uuid'); $uuid = $this->_request->getParam('uuid');
$sql="select m.id from normalmetadata m left join mdstatus s on m.uuid=s.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 "; 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); $where=$this->db->quoteInto('m.uuid = ?',$uuid);
@ -628,8 +629,9 @@ class DataController extends Zend_Controller_Action
$row=$this->db->fetchRow($sql); $row=$this->db->fetchRow($sql);
if (!$row) exit("读取信息错误"); if (!$row) exit("读取信息错误");
$id=$row['id']; $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)); $rows=$this->db->fetchAll($sql,array($id,$id));
$paginator = Zend_Paginator::factory($rows); $paginator = Zend_Paginator::factory($rows);