diff --git a/application/default/controllers/UploadController.php b/application/default/controllers/UploadController.php index 2ff95b09..a070c266 100644 --- a/application/default/controllers/UploadController.php +++ b/application/default/controllers/UploadController.php @@ -70,7 +70,7 @@ class UploadController extends Zend_Controller_Action { $row= $re->fetch(); return $row; } - + function delreviewattAction(){ $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); @@ -79,7 +79,6 @@ class UploadController extends Zend_Controller_Action { $basepath = $this->view->config->upload; $info = $this->getFileinfo($id); $filepath = $basepath.$info['filename']; - try{ $auth = Zend_Auth::getInstance(); if($auth->hasIdentity()) @@ -87,11 +86,12 @@ class UploadController extends Zend_Controller_Action { $user = $auth->getIdentity(); $userid = $user->id; $sql = "delete from attachments where id='$id' and userid='$userid'"; - if($this->db->exec($sql)) + if($this->db->exec($sql)>0) { @unlink($filepath); } } + }catch(Exception $e){} //不输出任何错误 }//删除评审附件