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";