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