From f8105975b11eb08fd3558ef5e985ea4c39c2de95 Mon Sep 17 00:00:00 2001 From: wlx Date: Wed, 11 Jun 2014 06:36:03 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=99=84=E4=BB=B6=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controllers/DataController.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 90a24927..2b292abd 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -532,7 +532,7 @@ class Admin_DataController extends Zend_Controller_Action $sql = "SELECT cm.*,md.title,(SELECT count(id) as counts FROM comments cms WHERE cms.reply=cm.id AND cms.reply!=0) as reply_count FROM comments cm - LEFT JOIN $submd md ON md.uuid=cm.uuid + right JOIN $submd md ON md.uuid=cm.uuid WHERE cm.reply=0 ORDER BY cm.ts_created DESC,cm.id DESC"; @@ -1186,8 +1186,8 @@ class Admin_DataController extends Zend_Controller_Action else { - - $sql="select * from attachments order by id desc"; + $submd=$this->view->config->sub->metadata; + $sql="select * from attachments where id in (select id from mdattach where uuid in (select uuid from $submd)) order by id desc"; $re= $this->db->query($sql); $rows = $re->fetchAll(); @@ -1197,11 +1197,7 @@ class Admin_DataController extends Zend_Controller_Action $paginator->setView($this->view); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); $this->view->paginator=$paginator; - }//所有附件 - - - - + }//所有附件 }//attachments 附件 function uploadAction(){