diff --git a/application/default/controllers/ServiceController.php b/application/default/controllers/ServiceController.php index ffbdacea..4eb1015a 100644 --- a/application/default/controllers/ServiceController.php +++ b/application/default/controllers/ServiceController.php @@ -642,6 +642,50 @@ class ServiceController extends Zend_Controller_Action } } + function getattsAction(){ + + $this->_helper->layout()->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $id = $this->_request->getParam('id'); + + if($id!='') + { + $auth = Zend_Auth::getInstance(); + if($auth->hasIdentity()) + { + $user = $auth->getIdentity(); + $userid = $user->id; + $sql = "select att.realname,att.id,att.filename from attachments att + left join mdreviewattach ratt on att.id=ratt.attachid + where ratt.reviewid=$id and att.userid=$userid"; + $rs = $this->db->query($sql); + $atts = $rs->fetchAll(); + + include_once('files.php'); + + foreach($atts as $k=>$v) + { + $imgct = files::getImageType($this->config->upload.$v['filename']); + + if(!isset($imgct['error'])) $preview = ''; + else $preview = ""; + + $atts[$k]['html']= $preview.$v['realname'].'[已完成]
'; + } + + echo Zend_Json::encode($atts); + exit(); + }else + { + exit(); + } + }else{ + exit(); + } + //不输出错误 + }//获取附件 + function filelistAction() { $uuid=$this->_request->getParam('uuid'); diff --git a/application/default/views/scripts/review/review.phtml b/application/default/views/scripts/review/review.phtml index b0c237d7..0d03ae3e 100755 --- a/application/default/views/scripts/review/review.phtml +++ b/application/default/views/scripts/review/review.phtml @@ -259,7 +259,7 @@ $(document).ready(function() { }); } - $.getJSON("/upload/getatts/id/review['id'];?>", function(data) { + $.getJSON("/service/getatts/id/review['id'];?>", function(data) { if(data) { $.each(data, function(key, val) {