fix #245, 同步数据来源

This commit is contained in:
wlx 2011-12-11 07:57:59 +00:00
parent 77b945842d
commit 84b1d45e6d
2 changed files with 14 additions and 2 deletions

View File

@ -1006,7 +1006,6 @@ class Admin_DataController extends Zend_Controller_Action
} }
$wheresql = array(); $wheresql = array();
if(!empty($q) && !empty($search)) if(!empty($q) && !empty($search))
@ -1118,6 +1117,18 @@ class Admin_DataController extends Zend_Controller_Action
}// 清除元数据来源记录 }// 清除元数据来源记录
elseif ($do=='sync') { //同步数据来源到metadata表
$redirect = "/admin/data/source/";
$sql = "update metadata m set source=s.uuid from source s right join datasource d on s.id=d.sourceid where m.uuid=d.uuid";
if($this->db->exec($sql))
{
$this->messenger->addMessage('成功同步数据来源');
$this->_redirect($redirect);
}else{
$this->messenger->addMessage('同步数据来源失败');
$this->_redirect($redirect);
}
}
else else
{ {

View File

@ -27,6 +27,7 @@
<div class="ctrlplan"> <div class="ctrlplan">
<a href="/admin/data/source">项目来源管理</a> <a href="/admin/data/source">项目来源管理</a>
<a href="/admin/data/source/do/add">添加项目来源</a> <a href="/admin/data/source/do/add">添加项目来源</a>
<a href="/admin/data/source/do/sync">同步项目来源(以此处为准)</a>
</div> </div>
<div class="search"> <div class="search">