fix bug #106. 处理重复申请数据的问题
This commit is contained in:
parent
36044538ab
commit
620afdfaec
|
@ -744,14 +744,17 @@ class DataController extends Zend_Controller_Action
|
|||
//首先判断离线申请的数据数量是否超过系统限制
|
||||
$sql="select count(*) as datacount from dataorder where (ts_approved is null) and userid=? and status>0 and status<6";
|
||||
$r=$this->db->fetchRow($sql,array($userid));
|
||||
if ($r['datacount']<$this->view->config->download->max) {
|
||||
//保证添加的离线数据申请未申请
|
||||
$sql="select count(*) as datacount from dataorder where (ts_approved is null) and userid=? and uuid=? and status=1";
|
||||
$r1=$this->db->fetchRow($sql,array($userid,$uuid));
|
||||
if ($r['datacount']<$this->view->config->download->max && $r1['datacount']<1) {
|
||||
$sql="insert into dataorder (uuid,ts_created,userid,status) values(?,now(),?,?)";
|
||||
$this->db->query($sql,array($uuid,$userid,1));
|
||||
//成功信息提示
|
||||
$sql=$this->db->quoteInto("select title,uuid from metadata where uuid=?",$uuid);
|
||||
$this->view->md=$this->db->fetchRow($sql);
|
||||
} else {
|
||||
$this->view->msg="错误:您正在进行的离线申请的数据数已经超过系统允许的最大值,请在完成本次离线申请后再进行操作!";
|
||||
$this->view->msg="错误:您正在进行的离线申请的数据数已经超过系统允许的最大值,请在完成本次离线申请后再进行操作!或者您申请的数据已经在数据蓝中。";
|
||||
}
|
||||
} elseif ($del) {
|
||||
//删除数据申请
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<?php endif; ?>
|
||||
<?php if ($this->dataorder1) : ?>
|
||||
<div id="dataorder1">
|
||||
<h1>准备提交的离线申请(<a href="/data/order/apply/all">提交所有离线申请</a> <a href="">下载所有在线数据</a>)</h1>
|
||||
<h1>准备提交的离线申请(<a href="/data/order/apply/all">提交所有离线申请</a>)</h1>
|
||||
<ul class="title"><li class="time">申请时间</li>
|
||||
<li class="datatype">数据类型</li>
|
||||
<li class="name">数据名称</li>
|
||||
|
|
Loading…
Reference in New Issue