From 6a38e0bcca1aacb19dba1c20489c70f1070eedcc Mon Sep 17 00:00:00 2001 From: wlx Date: Tue, 11 Jun 2013 07:07:01 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/ServiceController.php | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/application/default/controllers/ServiceController.php b/application/default/controllers/ServiceController.php index 46159492..b46cfb27 100644 --- a/application/default/controllers/ServiceController.php +++ b/application/default/controllers/ServiceController.php @@ -373,10 +373,8 @@ class ServiceController extends Zend_Controller_Action error_reporting(1); if (!empty($uuid)) { - $sql="select x.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.south,m.east,m.west,m.north,m.timebegin,m.timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype, - cc.name as category, cc.name_zh as category_zh + $sql="select g.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.south,m.east,m.west,m.north,date(m.timebegin) as timebegin,date(m.timeend) as timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype from metadata m left join xml x on m.id=x.id left join thumbnail t on x.id=t.id - left join category c on c.id=m.id left join categorycode cc on c.code=cc.code left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid); $row=$this->db->fetchRow($sql); $sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?"; @@ -387,7 +385,14 @@ class ServiceController extends Zend_Controller_Action { $reference.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$refer['reference'])."\r\n"; } - $row['reference']=$reference; + $row['reference']=$reference; + $sql="select cc.name as category, cc.name_zh from metadata m left join category c on m.id=c.id left join categorycode cc on c.code=cc.code where m.uuid=".$this->db->quote($uuid); + $cat=$this->db->fetchAll($sql); + $row['category_zh']=''; + foreach($cat as $category) + { + $row['category_zh'].=$category['name_zh'].' '; + } $sql="select u.uselimit from mdlimit ml left join metadata m on ml.uuid=m.uuid left join uselimit u on ml.lid=u.id where m.uuid=?"; $sql=$this->db->quoteInto($sql,$uuid); $limits=$this->db->fetchAll($sql); @@ -458,10 +463,8 @@ class ServiceController extends Zend_Controller_Action //error_reporting(1); if (!empty($uuid)) { - $sql="select x.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.south,m.east,m.west,m.north,m.timebegin,m.timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype, - cc.name as category, cc.name_zh as category_zh + $sql="select g.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.south,m.east,m.west,m.north,date(m.timebegin) as timebegin,date(m.timeend) as timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype from xml x left join metadata m on m.id=x.id left join thumbnail t on x.id=t.id - left join category c on c.id=m.id left join categorycode cc on c.code=cc.code left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid); $row=$this->db->fetchRow($sql); $sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?"; @@ -472,7 +475,14 @@ class ServiceController extends Zend_Controller_Action { $reference.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$refer['reference'])."\r\n"; } - $row['reference']=$reference; + $row['reference']=$reference; + $sql="select cc.name as category, cc.name_zh from metadata m left join category c on m.id=c.id left join categorycode cc on c.code=cc.code where m.uuid=".$this->db->quote($uuid); + $cat=$this->db->fetchAll($sql); + $row['category_zh']=''; + foreach($cat as $category) + { + $row['category_zh'].=$category['name_zh'].' '; + } $sql="select u.uselimit from mdlimit ml left join metadata m on ml.uuid=m.uuid left join uselimit u on ml.lid=u.id where m.uuid=?"; $sql=$this->db->quoteInto($sql,$uuid); $limits=$this->db->fetchAll($sql);