实现同步时的搜索更新

This commit is contained in:
wlx 2013-01-23 03:27:05 +00:00
parent 43d1f26b1a
commit 10d46816cc
1 changed files with 10 additions and 1 deletions

View File

@ -191,6 +191,15 @@ class Admin_DataController extends Zend_Controller_Action
$this->db->query("insert into mdstatus (uuid,status,ts_accepted,userid) select uuid,1,now(),? $this->db->query("insert into mdstatus (uuid,status,ts_accepted,userid) select uuid,1,now(),?
from geonetworkmetadata gn where uuid not in (select uuid from mdstatus) and uuid=?",array($userid,$uuid)); from geonetworkmetadata gn where uuid not in (select uuid from mdstatus) and uuid=?",array($userid,$uuid));
$this->view->msg='成功同步元数据:'.$uuid; $this->view->msg='成功同步元数据:'.$uuid;
//update search document
$search=new Search();
$sql="select * from xunsearch where uuid=?";
$sth = $this->db->prepare($sql);
$sth->setFetchMode(Zend_Db::FETCH_ASSOC);
$sth->execute(array($uuid));
$data = $sth->fetch();
$search->update($data);
} else $this->view->msg='不存在此元数据:'.$uuid; } else $this->view->msg='不存在此元数据:'.$uuid;
} }
} }