From 70a99bd3b00d7f6e46d7c1b9f0caf4bdc99b9ac3 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Mon, 12 Mar 2012 09:44:13 +0000 Subject: [PATCH] =?UTF-8?q?Ticket=20#303=20=E5=9C=A8=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E9=80=9A=E8=BF=87=E4=B9=8B=E5=89=8D=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E4=BA=86=E6=95=B0=E6=8D=AE=E4=BD=9C=E8=80=85=E7=9A=84?= =?UTF-8?q?=E6=84=8F=E8=A7=81=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/DownController.php | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/application/admin/controllers/DownController.php b/application/admin/controllers/DownController.php index 1421f288..95a81b15 100644 --- a/application/admin/controllers/DownController.php +++ b/application/admin/controllers/DownController.php @@ -26,7 +26,7 @@ class Admin_DownController extends Zend_Controller_Action $cancel =(int)$this->_getParam('cancel'); $deny =(int)$this->_getParam('deny'); $page =(int)$this->_getParam('page'); - $reset =(int)$this->_getParam('reset'); + $reset =(int)$this->_getParam('reset'); $status =(int)$this->_getParam('status'); if (!$page) $page=1; @@ -84,6 +84,16 @@ class Admin_DownController extends Zend_Controller_Action $this->_redirect('/admin/down/offlineapp/'.$page); } elseif ($finish) { try { + $sql = "SELECT authorpermitted FROM dataorder WHERE offlineappid=?"; + $sth = $this->db->prepare($sql); + $sth->execute(array($finish)); + $row = $sth->fetch(); + if($row['authorpermitted'] <0) + { + $this->messenger->addMessage('提示信息:数据作者明确反对该下载申请,所以不能进行进一步通过'); + $this->_redirect('/admin/down/offlineapp/'.$page); + } + $sql="update dataorder set status=5,ts_approved=now() where offlineappid=?"; $this->db->query($sql,array($finish)); $sql="update offlineapp set ts_approved=now() where id=? and ts_approved is null"; @@ -184,13 +194,13 @@ class Admin_DownController extends Zend_Controller_Action }//reset $select="select distinct(o.*),d.status as datastatus from offlineapp o - left join dataorder d on o.id=d.offlineappid"; + left join dataorder d on o.id=d.offlineappid"; if ($status==4) $select.=" where o.ts_approved is null - and o.pdflink is not null and d.status=4"; - elseif ($status==-1) - $select.=" where o.pdflink is not null and o.status=-1"; - else + and o.pdflink is not null and d.status=4"; + elseif ($status==-1) + $select.=" where o.pdflink is not null and o.status=-1"; + else $select.=" where o.ts_approved is null and o.pdflink is not null and d.status in (3,4)"; $select.=" order by o.ts_created desc";