更新数据评论管理的分平台限制

This commit is contained in:
wlx 2014-06-11 06:21:53 +00:00
parent 69e31efafc
commit 1a23c89ec2
1 changed files with 4 additions and 3 deletions

View File

@ -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";