From 53c323d1ca7690e0a57b036677fd84a7fd3db80a Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Fri, 25 Nov 2011 09:10:20 +0000 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BA=86ajax=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E5=85=83=E6=95=B0=E6=8D=AE=E8=AF=84=E5=AE=A1=E6=84=8F?= =?UTF-8?q?=E8=A7=81=E9=99=84=E4=BB=B6=E7=9A=84=E5=8A=A8=E4=BD=9C=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=96=87=E4=BB=B6=E7=9A=84=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE=E9=A2=84=E8=A7=88=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/ServiceController.php | 44 +++++++++++++++++++ .../default/views/scripts/review/review.phtml | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) 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) {