revert last change except fixoffline

This commit is contained in:
wlx 2011-09-19 03:26:29 +00:00
parent 833bde8c1d
commit 50b7d77103
1 changed files with 12 additions and 10 deletions

View File

@ -312,7 +312,7 @@ class Admin_DownController extends Zend_Controller_Action
}//查看单条记录 }//查看单条记录
$select=$this->db->select(); $select=$this->db->select();
$select->from('offlineapp')->where('ts_approved is not null')->where('pdflink is not null and status>=0')->order('ts_created desc'); $select->from('offlineapp')->where('ts_approved is not null')->where('pdflink is not null')->order('ts_created desc');
$paginator = Zend_Paginator::factory($select); $paginator = Zend_Paginator::factory($select);
$paginator->setCurrentPageNumber($this->_getParam('page')); $paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage($this->view->config->page->max); $paginator->setItemCountPerPage($this->view->config->page->max);
@ -379,8 +379,9 @@ class Admin_DownController extends Zend_Controller_Action
if(empty($show)) if(empty($show))
{ {
$select=$this->db->select(); $select=$this->db->select();
$select->from('onlineapp as o','count(o.id) as num') $select->from('dataorder as o','count(o.id) as num')
->join('users as u', 'u.id = o.userid', array('realname','id as uid')) ->join('users as u', 'u.id = o.userid', array('realname','id as uid','unit'))
->where('o.status=0 or o.status=5')
->where('o.userid = u.id'); ->where('o.userid = u.id');
if(!empty($search) && !empty($keyword)) if(!empty($search) && !empty($keyword))
{ {
@ -389,6 +390,7 @@ class Admin_DownController extends Zend_Controller_Action
} }
$select ->group('uid') $select ->group('uid')
->group('realname') ->group('realname')
->group('unit')
->order('num desc'); ->order('num desc');
$paginator = Zend_Paginator::factory($select); $paginator = Zend_Paginator::factory($select);
$paginator->setCurrentPageNumber($this->_getParam('page')); $paginator->setCurrentPageNumber($this->_getParam('page'));
@ -404,9 +406,11 @@ class Admin_DownController extends Zend_Controller_Action
elseif($show) elseif($show)
{ {
$select=$this->db->select(); $select=$this->db->select();
$select->from('onlineapp as o',array('id','username','ts_created','userid')) $select->from('dataorder as o',array('id','ts_created','userid','offlineappid'))
->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid')) ->joinLeft('metadata as m', 'o.uuid = m.uuid', array('title','uuid'))
->joinLeft('users as u','u.id=o.userid',array('realname as username'))
->where('o.userid = ?', $show) ->where('o.userid = ?', $show)
->where('o.status=0 or o.status=5')
->order('o.id desc'); ->order('o.id desc');
$paginator = Zend_Paginator::factory($select); $paginator = Zend_Paginator::factory($select);
$paginator->setCurrentPageNumber($this->_getParam('page')); $paginator->setCurrentPageNumber($this->_getParam('page'));
@ -439,7 +443,7 @@ class Admin_DownController extends Zend_Controller_Action
->where('o.uuid = m.uuid and (o.status=0 or o.status=5)'); ->where('o.uuid = m.uuid and (o.status=0 or o.status=5)');
if(!empty($search) && !empty($keyword)) if(!empty($search) && !empty($keyword))
{ {
$select ->Where('m.title like ? ','%'.$keyword.'%'); $select ->Where('m.title like ? or m.title_en like ?','%'.$keyword.'%');
$this->view->title='“'.$keyword.'”的搜索结果 :'; $this->view->title='“'.$keyword.'”的搜索结果 :';
} }
$select ->group('m.title') $select ->group('m.title')
@ -460,7 +464,7 @@ class Admin_DownController extends Zend_Controller_Action
elseif($show) elseif($show)
{ {
$select=$this->db->select(); $select=$this->db->select();
$select->from('dataorder as o',array('ts_created')) $select->from('dataorder as o',array('ts_created','ts_created','offlineappid'))
->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid')) ->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid'))
->join('users as u', 'o.userid=u.id',array('id as userid','username','realname')) ->join('users as u', 'o.userid=u.id',array('id as userid','username','realname'))
->where('m.uuid = ? and (o.status=0 or o.status=5)', $show) ->where('m.uuid = ? and (o.status=0 or o.status=5)', $show)
@ -554,7 +558,6 @@ class Admin_DownController extends Zend_Controller_Action
$this->_helper->viewRenderer('update'); $this->_helper->viewRenderer('update');
} }
function fixofflineAction(){ function fixofflineAction(){
$fix = $this->_getParam('fix'); $fix = $this->_getParam('fix');
@ -622,7 +625,6 @@ class Admin_DownController extends Zend_Controller_Action
} }
}//fixofflineAction 用户匹配 }//fixofflineAction 用户匹配
} }