From 3f1a01352a2fa46f047b3b7e588ac95acc64abbe Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Fri, 16 Sep 2011 03:21:19 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E9=87=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/DownController.php | 32 ++++++++++++++++++- .../admin/views/scripts/down/offlineapp.phtml | 6 +++- 2 files changed, 36 insertions(+), 2 deletions(-) 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 @@ 收到通过删除 - 拒绝 + 拒绝 + 重置 +