From 1a23c89ec2839dbc0aa25c70fe3367467f245ede Mon Sep 17 00:00:00 2001 From: wlx Date: Wed, 11 Jun 2014 06:21:53 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E7=AE=A1=E7=90=86=E7=9A=84=E5=88=86=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controllers/DataController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 4fc1dd65..90a24927 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -390,10 +390,11 @@ class Admin_DataController extends Zend_Controller_Action $reply = $this->_getParam('reply'); $replylist = $this->_getParam('replylist'); $delreply = $this->_getParam('delreply'); + $submd=$this->view->config->sub->metadata; if ($delete) { - $sql="delete from comments where id=?"; + $sql="delete from comments where id=? and uuid in (select uuid from $submd)"; try { $this->db->query($sql,array($delete)); $this->messenger->addMessage('提示信息:您已经成功删除该评论。'); @@ -465,7 +466,7 @@ class Admin_DataController extends Zend_Controller_Action if($uuid) { $sql = "SELECT c.*,md.title,md.uuid FROM comments c - LEFT JOIN metadata md ON md.uuid=c.uuid + LEFT JOIN $submd md ON md.uuid=c.uuid WHERE c.uuid=?"; $sth = $this->db->prepare($sql); $sth->execute(array($uuid)); @@ -531,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 metadata md ON md.uuid=cm.uuid + LEFT JOIN $submd md ON md.uuid=cm.uuid WHERE cm.reply=0 ORDER BY cm.ts_created DESC,cm.id DESC";