From 5c80a790a32d314933b4d3a480801c1b57a3383e Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Tue, 8 Nov 2011 08:00:24 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8review=E4=B8=AD=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E4=B8=8B=E8=BD=BD=E5=88=A4=E6=96=AD=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=AE=E6=A0=87=E7=AA=97=E5=8F=A3=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/ReviewController.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php index 8b43bed6..37c4bdf4 100644 --- a/application/admin/controllers/ReviewController.php +++ b/application/admin/controllers/ReviewController.php @@ -910,11 +910,9 @@ class Admin_ReviewController extends Zend_Controller_Action $this->_redirect($redirect); } - $sql = "select r.id,r.uuid,r.mdcomment,r.datacomment,r.editorcomment,u.realname,md.title,att.filename,r.ts_created,r.conclusion,ratt.attachid as attid from mdreview r + $sql = "select r.*,md.title,u.realname,u.id as uid from mdreview r left join metadata md on md.uuid=r.uuid left join users u on u.id=r.userid - left join mdreviewattach ratt on ratt.reviewid=r.id - left join attachments att on att.id=ratt.attachid where r.id='$id' "; @@ -922,9 +920,19 @@ class Admin_ReviewController extends Zend_Controller_Action $row = $rs->fetch(); - if(!empty($row['attid'])) + $sql = "select att.realname,att.id from attachments att + left join mdreviewattach ratt on att.id=ratt.attachid + where ratt.reviewid=$id"; + $rs = $this->db->query($sql); + $rows = $rs->fetchAll(); + + $row['attid'] = ""; + if(!empty($rows)) { - $row['attid'] = '下载'; + foreach($rows as $v) + { + $row['attid'] .= '
  • '.$v['realname'].'下载
  • '; + } } else {