调整参数传递方式

This commit is contained in:
wlx 2011-09-14 05:07:25 +00:00
parent 8555a89098
commit f8c385e1a0
1 changed files with 23 additions and 25 deletions

View File

@ -237,9 +237,10 @@ class Admin_DownController extends Zend_Controller_Action
//在线数据下载情况仅针对onlineapp表自2011-9-8开始记录。
function onlineAction()
{
$ac=$this->_getParam('ac');
$id=(int)$this->_getParam('id');
if(empty($ac) || empty($id))
$show=(int)$this->_getParam('show');
$delete=(int)$this->_getParam('delete');
if(empty($show) && empty($delete))
{
$select=$this->db->select();
$select->from('onlineapp as o',array('id','userid','unit','username','ts_created','project'))
@ -258,7 +259,7 @@ class Admin_DownController extends Zend_Controller_Action
$this->view->t=$t;
}//列表
if($ac=='delete' && !empty($id))
elseif($delete)
{
$sql="delete from onlineapp where id=?";
try {
@ -270,14 +271,14 @@ class Admin_DownController extends Zend_Controller_Action
$this->_redirect("/admin/down/online/");
}//删除
if($ac=='show' && !empty($id))
elseif($show)
{
$sql ="select o.*,u.username as uname,u.id as uid,m.title,m.uuid
from onlineapp as o
left join users as u on u.id = o.userid
left join metadata as m on o.uuid = m.uuid
where o.id=?";
$result =$this->db->query($sql,$id);
$result =$this->db->query($sql,$show);
$rows = $result->fetch();
$this->view->infos=$rows;
@ -287,10 +288,9 @@ class Admin_DownController extends Zend_Controller_Action
function userAction()
{
$ac=$this->_getParam('ac');
$id=(int)$this->_getParam('id');
$show=(int)$this->_getParam('show');
if(empty($ac)|| empty($id))
if(empty($show))
{
$select=$this->db->select();
$select->from('onlineapp as o','count(o.id) as num')
@ -301,27 +301,27 @@ class Admin_DownController extends Zend_Controller_Action
->order('num desc');
$paginator = Zend_Paginator::factory($select);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(30);
$paginator->setItemCountPerPage($this->view->config->page->max);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
}//列表
if($ac=='show' && !empty($id))
elseif($show)
{
$select=$this->db->select();
$select->from('onlineapp as o',array('id','username','ts_created'))
$select->from('onlineapp as o',array('id','username','ts_created','userid'))
->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid'))
->where('o.userid = ?', $id)
->where('o.userid = ?', $show)
->order('o.id desc');
$paginator = Zend_Paginator::factory($select);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(30);
$paginator->setItemCountPerPage($this->view->config->page->max);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
$sql="select username,realname from users where id='$id'";
$sql="select username,realname from users where id='$show'";
$re=$this->db->query($sql);
$t=$re->fetch();
$this->view->infos=$t;
@ -333,10 +333,9 @@ class Admin_DownController extends Zend_Controller_Action
function dataAction()
{
$ac=$this->_getParam('ac');
$uuid = $this->_request->getParam('uuid');
if(empty($ac) || $ac=='list')
$show=$this->_getParam('show');
if(empty($show))
{
$select=$this->db->select();
$select->from('onlineapp as o','count(o.id) as num')
@ -347,19 +346,18 @@ class Admin_DownController extends Zend_Controller_Action
->order('num desc');
$paginator = Zend_Paginator::factory($select);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(30);
$paginator->setItemCountPerPage($this->view->config->page->max);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
}//数据下载情况列表
if($ac=='show' && !empty($uuid))
elseif($show)
{
$select=$this->db->select();
$select->from('onlineapp as o',array('id','username','ts_created'))
$select->from('onlineapp as o',array('id','username','ts_created','userid'))
->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid'))
->where('m.uuid = ?', $uuid)
->where('m.uuid = ?', $show)
->order('o.id desc');
$paginator = Zend_Paginator::factory($select);
$paginator->setCurrentPageNumber($this->_getParam('page'));
@ -368,7 +366,7 @@ class Admin_DownController extends Zend_Controller_Action
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
$sql="select title from metadata where uuid='$uuid'";
$sql="select title from metadata where uuid='$show'";
$re=$this->db->query($sql);
$t=$re->fetch();
$this->view->infos=$t;