From 84b1d45e6d653f36c7cf0f9dd2ea64890c38e97e Mon Sep 17 00:00:00 2001 From: wlx Date: Sun, 11 Dec 2011 07:57:59 +0000 Subject: [PATCH] =?UTF-8?q?fix=20#245,=20=E5=90=8C=E6=AD=A5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controllers/DataController.php | 13 ++++++++++++- application/admin/views/scripts/data/source.phtml | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index d24bfb4f..df9bf8c1 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -1006,7 +1006,6 @@ class Admin_DataController extends Zend_Controller_Action } - $wheresql = array(); 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 { diff --git a/application/admin/views/scripts/data/source.phtml b/application/admin/views/scripts/data/source.phtml index 94f411f1..d0a4b5e2 100644 --- a/application/admin/views/scripts/data/source.phtml +++ b/application/admin/views/scripts/data/source.phtml @@ -26,7 +26,8 @@
项目来源管理 - 添加项目来源 + 添加项目来源 + 同步项目来源(以此处为准)