实现元数据评审中的接收与取消对应的搜索更新和删除操作

This commit is contained in:
wlx 2013-01-23 03:28:22 +00:00
parent 10d46816cc
commit ffaee3f502
1 changed files with 21 additions and 2 deletions

View File

@ -148,7 +148,15 @@ class Admin_ReviewController extends Zend_Controller_Action
if($cancel>0) if($cancel>0)
{ {
if($this->changestatus($cancel,-1)) if($this->changestatus($cancel,-1))
{ {
//update search document
$search=new Search();
//create search view in xunsearch
$sql="select * from xunsearch where uuid in (select uuid from metadata where id=?)";
$sth = $this->db->prepare($sql);
$sth->execute(array($cancel));
$data = $sth->fetch();
$search->update($data);
$this->messenger->addMessage('操作成功:已取消该数据的评审'); $this->messenger->addMessage('操作成功:已取消该数据的评审');
$this->_redirect("/admin/review/accept"); $this->_redirect("/admin/review/accept");
} }
@ -743,7 +751,18 @@ class Admin_ReviewController extends Zend_Controller_Action
else $ids=$update; else $ids=$update;
if($this->changestatus($ids,1)) if($this->changestatus($ids,1))
{ {
//update search document
$search=new Search();
//create search view in xunsearch
$sql="select * from xunsearch where uuid in (select uuid from metadata where id in (?))";
$sth = $this->db->prepare($sql);
$sth->execute(array($ids));
while ($data = $sth->fetch())
{
$search->update($data);
}
//仅对单条数据发送email信息并且注册为数据作者 //仅对单条数据发送email信息并且注册为数据作者
if (is_numeric($ids)) if (is_numeric($ids))
{ {