From 817f305c431f2b1b446ec9f56f98873ef177bd7a Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Fri, 16 Sep 2011 05:34:05 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=B8=80=E5=A4=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BA=86=E5=88=86=E9=A1=B5=E6=BA=90=E6=95=B0=E6=8D=AE=E8=BE=93?= =?UTF-8?q?=E5=85=A5=EF=BC=8Czf=5Fdb=E4=B8=8D=E6=94=AF=E6=8C=81=E9=AB=98?= =?UTF-8?q?=E7=BA=A7=E8=81=94=E5=90=88=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/DownController.php | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/application/admin/controllers/DownController.php b/application/admin/controllers/DownController.php index 93fafe60..66ddb57d 100644 --- a/application/admin/controllers/DownController.php +++ b/application/admin/controllers/DownController.php @@ -133,7 +133,7 @@ class Admin_DownController extends Zend_Controller_Action $this->_redirect('/admin/down/offlineapp/'.$page); } else if($reset){ - if($reset < 1) + if($reset < 0) { $fortime = date('Y-m-d',(time()-24*3600*365)); @@ -147,8 +147,9 @@ class Admin_DownController extends Zend_Controller_Action } else if($reset > 0) { - $sql="update dataorder set status='1' where offlineappid='$reset'"; - if($this->db->exec($sql)<1) + $search="select * from offlineapp where"; + $sql="update dataorder set status='1' where status='3' and offlineappid='$reset'"; + if($this->db->exec($sql)>0) { $this->messenger->addMessage('已经成功对该申请重置'); $this->_redirect('/admin/down/offlineapp/'); @@ -160,14 +161,24 @@ class Admin_DownController extends Zend_Controller_Action }//elseif //if }//reset - $select=$this->db->select(); + /*$select=$this->db->select(); $select ->from('offlineapp as o') ->join('dataorder as d','o.id = d.offlineappid') ->where('o.ts_approved is null') ->where('o.pdflink is not null') ->where('d.status=3') - ->order('o.ts_created desc'); - $paginator = Zend_Paginator::factory($select); + //->where('d.offlineappid>0') + ->order('o.ts_created desc');*/ + + $select="select o.*,d.status,d.offlineappid from offlineapp o + left join dataorder d on o.id=d.offlineappid + where o.ts_approved is null + and o.pdflink is not null + and d.status=3 + order by o.ts_created desc"; + $rs=$this->db->query($select); + $rows=$rs->fetchAll(); + $paginator = Zend_Paginator::factory($rows); $paginator->setCurrentPageNumber($page); $paginator->setItemCountPerPage($this->view->config->page->max); $paginator->setView($this->view);