diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index bbac219e..af7364cd 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -35,7 +35,7 @@ class Admin_DataController extends Zend_Controller_Action //$uuid=$this->_request->getParam('uuid'); if ($source=="geonetwork" && empty($uuid) ) { //从geonetwork向WESTDC同步 - $sql="select uuid,data from geonetworkmetadata where schemaid='iso19115'"; + $sql="select uuid,data,source from geonetworkmetadata where schemaid='iso19115'"; $rs=$this->db->fetchAll($sql); foreach($rs as $gmd) { $this->import($gmd->data); @@ -45,12 +45,12 @@ class Admin_DataController extends Zend_Controller_Action } elseif ($source=="watergn" && empty($uuid) ) { //首先删除所有的黑河试验数据 //$sql="delete from metadata where source='e3ad32dc-f573-11e0-aa7b-b768cfd88d80'"; - $sql="delete from metadata where uuid in (select uuid from heihegn)"; + $sql="delete from metadata where uuid in (select uuid from watergn)"; $this->db->query($sql); $sql="delete from responsible where id not in (select distinct(resid) from role)"; $this->db->query($sql); //同步黑河遥感实验的元数据 - $sql="select uuid,data,source from heihegn where schemaid='iso19115'"; + $sql="select uuid,data,source from watergn where schemaid='iso19115'"; $rs=$this->db->fetchAll($sql); foreach($rs as $gmd) { $this->import($gmd->data); @@ -68,7 +68,7 @@ class Admin_DataController extends Zend_Controller_Action $sql="select m.uuid,m.source,x.data from metadata m left join xml x on m.id=x.id where m.uuid in (select uuid from geonetworkmetadata)"; $rs=$this->db->fetchAll($sql); foreach($rs as $gmd) { - $sql="update geonetworkmetadata set source='".$gmd->source."',data=".$this->db->quote($gmd->data)." where uuid='".$gmd->uuid."'"; + $sql="update geonetworkmetadata set source='".$gmd->source."',data=".$this->db->quote($gmd->data)." where uuid='".$gmd->uuid."'"; $this->db->exec($sql); } $this->view->msg='成功同步WESTDC元数据到GEONETWORK!';