修复数据分类问题

This commit is contained in:
wlx 2013-06-11 07:07:01 +00:00
parent 6265948c41
commit 6a38e0bcca
1 changed files with 18 additions and 8 deletions

View File

@ -373,10 +373,8 @@ class ServiceController extends Zend_Controller_Action
error_reporting(1); error_reporting(1);
if (!empty($uuid)) 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, $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
cc.name as category, cc.name_zh as category_zh
from metadata m left join xml x on m.id=x.id left join thumbnail t on x.id=t.id 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); left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
$row=$this->db->fetchRow($sql); $row=$this->db->fetchRow($sql);
$sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?"; $sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?";
@ -388,6 +386,13 @@ class ServiceController extends Zend_Controller_Action
$reference.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$refer['reference'])."\r\n"; $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="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); $sql=$this->db->quoteInto($sql,$uuid);
$limits=$this->db->fetchAll($sql); $limits=$this->db->fetchAll($sql);
@ -458,10 +463,8 @@ class ServiceController extends Zend_Controller_Action
//error_reporting(1); //error_reporting(1);
if (!empty($uuid)) 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, $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
cc.name as category, cc.name_zh as category_zh
from xml x left join metadata m on m.id=x.id left join thumbnail t on x.id=t.id 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); left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
$row=$this->db->fetchRow($sql); $row=$this->db->fetchRow($sql);
$sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?"; $sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?";
@ -473,6 +476,13 @@ class ServiceController extends Zend_Controller_Action
$reference.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$refer['reference'])."\r\n"; $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="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); $sql=$this->db->quoteInto($sql,$uuid);
$limits=$this->db->fetchAll($sql); $limits=$this->db->fetchAll($sql);