修改文件上传时的逻辑错误

This commit is contained in:
Li Jianxuan 2011-10-14 09:33:44 +00:00
parent 889d4a4bbf
commit d55e2f9cec
1 changed files with 5 additions and 5 deletions

View File

@ -44,9 +44,9 @@ class Admin_DataController extends Zend_Controller_Action
$this->view->msg='成功同步元数据!'; $this->view->msg='成功同步元数据!';
} elseif ($source=="watergn" && empty($uuid) ) { } elseif ($source=="watergn" && empty($uuid) ) {
//首先删除所有的黑河试验数据 //首先删除所有的黑河试验数据
//$sql="delete from metadata where source='e3ad32dc-f573-11e0-aa7b-b768cfd88d80'"; //$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 heihegn)";
$this->db->query($sql); $this->db->query($sql);
$sql="delete from responsible where id not in (select distinct(resid) from role)"; $sql="delete from responsible where id not in (select distinct(resid) from role)";
$this->db->query($sql); $this->db->query($sql);
//同步黑河遥感实验的元数据 //同步黑河遥感实验的元数据
@ -388,7 +388,7 @@ class Admin_DataController extends Zend_Controller_Action
$select=$this->db->select(); $select=$this->db->select();
$select->from('metadata') $select->from('metadata')
->joinLeft('mdstat','metadata.uuid=mdstat.uuid','viewed') ->joinLeft('mdstat','metadata.uuid=mdstat.uuid','viewed')
->joinLeft('geonetworkmetadata','geonetworkmetadata.uuid=metadata.uuid','id as gid') ->joinLeft('geonetworkmetadata','geonetworkmetadata.uuid=metadata.uuid','id as gid')
->joinLeft('mdstatus','metadata.uuid=mdstatus.uuid','status as mdstatus') ->joinLeft('mdstatus','metadata.uuid=mdstatus.uuid','status as mdstatus')
->order('metadata.id desc'); ->order('metadata.id desc');
$paginator = Zend_Paginator::factory($select); $paginator = Zend_Paginator::factory($select);
@ -851,14 +851,14 @@ class Admin_DataController extends Zend_Controller_Action
else else
{ {
$this->messenger->addMessage('读取用户信息出错'); $this->messenger->addMessage('读取用户信息出错');
$this->_redirect("/admin/data/attachments/add/1");
@unlink($filename); @unlink($filename);
$this->_redirect("/admin/data/attachments/add/1");
} }
}else }else
{ {
$this->messenger->addMessage('附件上传失败:'.$msg['error']); $this->messenger->addMessage('附件上传失败:'.$msg['error']);
$this->_redirect("/admin/data/attachments/add/1");
@unlink($filename); @unlink($filename);
$this->_redirect("/admin/data/attachments/add/1");
} }
} }
}//附件添加 }//附件添加