修复同步时未同步source错误

This commit is contained in:
wlx 2011-10-25 08:48:51 +00:00
parent 3cbdd0bf71
commit bcfb19fecc
1 changed files with 4 additions and 4 deletions

View File

@ -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);