From f570cb3c0343a021beac2b9e366c4491b55d60ad Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 15 Sep 2011 02:14:06 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=92=8C=E7=94=A8=E6=88=B7=E7=9A=84=E6=90=9C=E7=B4=A2=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/DownController.php | 37 +++++++++++++++---- .../admin/views/scripts/down/data.phtml | 14 +++++++ .../admin/views/scripts/down/user.phtml | 13 +++++++ 3 files changed, 56 insertions(+), 8 deletions(-) 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;?> 数据下载记录
+ + +
数据
姓名