From 8d490b16eb7b49d0aa437adb0dd8f20dc1b7582e Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 1 Jul 2010 11:34:16 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0DOI=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/TestController.php | 22 +++++++++++ .../admin/views/scripts/test/doi.phtml | 39 +++++++++++++++++++ .../admin/views/scripts/test/left.phtml | 2 +- 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 application/admin/views/scripts/test/doi.phtml diff --git a/application/admin/controllers/TestController.php b/application/admin/controllers/TestController.php index 3aff2c36..b96f6d64 100644 --- a/application/admin/controllers/TestController.php +++ b/application/admin/controllers/TestController.php @@ -38,6 +38,28 @@ class Admin_TestController extends Zend_Controller_Action } $this->view->ref=$ref; } + + //检查DOI是否有重复 + function doiAction() + { + $sql="select doi,uuid,title from metadata where doi<>'' order by doi"; + $rows=$this->db->fetchAll($sql); + $sql="select distinct(doi) from metadata where doi<>'' order by doi"; + $drows=$this->db->fetchAll($sql); + $c=0; + if (count($rows)!=count($drows)) + { + foreach($rows as $k=>$row) + { + if ($row['doi']!=$drows[$k-$c]['doi']) + { + $c++; + $doi[]=$row; + } + } + $this->view->doi=$doi; + } + } } diff --git a/application/admin/views/scripts/test/doi.phtml b/application/admin/views/scripts/test/doi.phtml new file mode 100644 index 00000000..41f0cc4c --- /dev/null +++ b/application/admin/views/scripts/test/doi.phtml @@ -0,0 +1,39 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('数据测试工具'); + $this->breadcrumb('DOI重复检查'); + $this->breadcrumb()->setSeparator(' > '); +?> +
+partial('test/left.phtml'); ?> +
+
+msg or $this->messages) :?> +
+msg) : ?> +

msg; ?>

+messages): foreach($this->messages as $msg): ?> +

+ +
+ + +doi) : ?> +
+DOI有重复的数据: +doi as $doi): ?> +
    +
  • +
  • +
+ +
+ +恭喜!没有重复。 + +
\ No newline at end of file diff --git a/application/admin/views/scripts/test/left.phtml b/application/admin/views/scripts/test/left.phtml index 1995a603..874accef 100644 --- a/application/admin/views/scripts/test/left.phtml +++ b/application/admin/views/scripts/test/left.phtml @@ -1,6 +1,6 @@