diff --git a/application/admin/controllers/DownController.php b/application/admin/controllers/DownController.php index 1f9c4b19..0a2e6442 100644 --- a/application/admin/controllers/DownController.php +++ b/application/admin/controllers/DownController.php @@ -286,15 +286,22 @@ class Admin_DownController extends Zend_Controller_Action function userAction() { - $show=(int)$this->_getParam('show'); + $show =(int)$this->_getParam('show'); + $search = $this->_getParam('search'); + $keyword = $this->view->keyword = $this->_getParam('keyword'); if(empty($show)) { $select=$this->db->select(); $select->from('onlineapp as o','count(o.id) as num') ->join('users as u', 'u.id = o.userid', array('realname','id as uid')) - ->where('o.userid = u.id') - ->group('uid') + ->where('o.userid = u.id'); + if(!empty($search) && !empty($keyword)) + { + $select ->Where('u.realname like ? ','%'.$keyword.'%'); + $this->view->title='“'.$keyword.'”的搜索结果 :'; + } + $select ->group('uid') ->group('realname') ->order('num desc'); $paginator = Zend_Paginator::factory($select); @@ -303,6 +310,9 @@ class Admin_DownController extends Zend_Controller_Action $paginator->setView($this->view); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); $this->view->paginator=$paginator; + + $count = count($this->db->fetchAll($select)); + $this->view->count=$count; }//列表 elseif($show) @@ -331,23 +341,34 @@ class Admin_DownController extends Zend_Controller_Action function dataAction() { - $show=$this->_getParam('show'); + $show = $this->_getParam('show'); + $search = $this->_getParam('search'); + $keyword = $this->view->keyword = $this->_getParam('keyword'); if(empty($show)) { $select=$this->db->select(); $select->from('dataorder as o','count(o.id) as num') ->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid')) - ->where('o.uuid = m.uuid and (o.status=0 or o.status=5)') - ->group('m.title') + ->where('o.uuid = m.uuid and (o.status=0 or o.status=5)'); + if(!empty($search) && !empty($keyword)) + { + $select ->Where('m.title like ? ','%'.$keyword.'%'); + $this->view->title='“'.$keyword.'”的搜索结果 :'; + } + $select ->group('m.title') ->group('m.uuid') ->order('num desc'); $paginator = Zend_Paginator::factory($select); $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage($this->view->config->page->max); + $paginator->setItemCountPerPage(20); $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); $this->view->paginator=$paginator; + + $count = count($this->db->fetchAll($select)); + $this->view->count=$count; + }//数据下载情况列表 elseif($show) diff --git a/application/admin/views/scripts/down/data.phtml b/application/admin/views/scripts/down/data.phtml index ccfccacf..4aa8d6fe 100755 --- a/application/admin/views/scripts/down/data.phtml +++ b/application/admin/views/scripts/down/data.phtml @@ -5,6 +5,7 @@ $this->headLink()->appendStylesheet('/css/admin.css'); $this->breadcrumb('首页'); $this->breadcrumb('后台管理首页'); + $this->breadcrumb('申请管理'); $this->breadcrumb('在线下载记录'); $this->breadcrumb()->setSeparator(' > '); $this->headScript()->appendFile('/js/prototype.js'); @@ -27,6 +28,19 @@
+ +
title)) echo $this->title;?>共 count;?> 数据下载记录
+ + + diff --git a/application/admin/views/scripts/down/user.phtml b/application/admin/views/scripts/down/user.phtml index 22a26ec3..5413473d 100755 --- a/application/admin/views/scripts/down/user.phtml +++ b/application/admin/views/scripts/down/user.phtml @@ -28,6 +28,19 @@
+ +
title)) echo $this->title;?>共 count;?> 数据下载记录
+ + +
数据
姓名