添加DOI重复检查功能

This commit is contained in:
wlx 2010-07-01 11:34:16 +00:00
parent c239e0c02a
commit 8d490b16eb
3 changed files with 62 additions and 1 deletions

View File

@ -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;
}
}
}

View File

@ -0,0 +1,39 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('<a href="/admin/test">数据测试工具</a>');
$this->breadcrumb('DOI重复检查');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="leftPanel">
<?= $this->partial('test/left.phtml'); ?>
</div>
<div id="rightPanel">
<?php if ($this->msg or $this->messages) :?>
<div id="message">
<?php if ($this->msg) : ?>
<p><?php echo $this->msg; ?></p>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
<p><?php echo $msg; ?></p>
<?php endforeach;endif; ?>
</div>
<?php endif; ?>
<?php if ($this->doi) : ?>
<div id="mdlist">
DOI有重复的数据
<?php foreach ($this->doi as $doi): ?>
<ul>
<li><?php echo $doi['doi']; ?></li>
<li><a href="/data/<?= $doi['uuid']; ?>"><?php echo $doi['title']; ?></a></li>
</ul>
<?php endforeach; ?>
</div>
<?php else : ?>
恭喜!没有重复。
<?php endif; ?>
</div>

View File

@ -1,6 +1,6 @@
<ul>
<li><a href="/admin/test/reftest">文献链接测试</a></li>
<li><a href="/admin/watermd/uselimit">数据使用声明处理</a></li>
<li><a href="/admin/test/doi">DOI重复检查</a></li>
<li><a href="/admin/watermd/reference">数据文献管理</a></li>
<li><a href="/admin/watermd/import">上传元数据文件</a></li>
<li><a href="/admin/watermd/batchimport">导入服务器元数据目录</a></li>