diff --git a/application/admin/controllers/DownController.php b/application/admin/controllers/DownController.php index 0588f7c7..361d9712 100644 --- a/application/admin/controllers/DownController.php +++ b/application/admin/controllers/DownController.php @@ -26,6 +26,8 @@ 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'); + if (!$page) $page=1; if ($view) { //查看此次申请的pdf @@ -129,7 +131,35 @@ class Admin_DownController extends Zend_Controller_Action $this->db->query($sql,array($deny)); $this->messenger->addMessage('提示信息:已拒绝该用户离线申请。'); $this->_redirect('/admin/down/offlineapp/'.$page); - } + } else if($reset){ + + if($reset < 1) + { + + $fortime = date('Y-m-d',(time()-24*3600*365)); + $sql="update dataorder set status=1 where ts_created < '$fortime'"; + if($this->db->exec($sql)>0) + { + $this->messenger->addMessage('已经成功重置了 '.$fortime.' 前的所有申请'); + $this->_redirect('/admin/down/offlineapp/'); + } + + } + else if($reset > 0) + { + $sql="update dataorder set status='1' where offlineappid='$reset'"; + if($this->db->exec($sql)<1) + { + $this->messenger->addMessage('已经成功对该申请重置'); + $this->_redirect('/admin/down/offlineapp/'); + } + else { + $this->messenger->addMessage('没有找到对应数据,无法进行重置,可能是旧记录没有匹配数据造成的'); + $this->_redirect('/admin/down/offlineapp/'); + } + }//elseif + //if + }//reset $select=$this->db->select(); $select->from('offlineapp')->where('ts_approved is null')->where('pdflink is not null and status>=0')->order('ts_created desc'); $paginator = Zend_Paginator::factory($select); diff --git a/application/admin/views/scripts/down/offlineapp.phtml b/application/admin/views/scripts/down/offlineapp.phtml index 6617896f..32451d5f 100644 --- a/application/admin/views/scripts/down/offlineapp.phtml +++ b/application/admin/views/scripts/down/offlineapp.phtml @@ -26,6 +26,8 @@
离线数据申请管理
+重置1年前的所有未收到申请表的记录 + paginator)): ?> @@ -54,7 +56,9 @@ 收到通过删除 - 拒绝 + 拒绝 + 重置 +