优化支持项目操作

This commit is contained in:
wlx 2013-05-28 05:36:26 +00:00
parent 8e8737cf49
commit ca13409673
3 changed files with 18 additions and 14 deletions

View File

@ -3424,7 +3424,7 @@ class Admin_DataController extends Zend_Controller_Action
{ {
$this->_helper->viewRenderer('fund-data-list'); $this->_helper->viewRenderer('fund-data-list');
$this->view->q = $q = $this->_getParam('q'); $this->view->q = $q = $this->_getParam('q');
$rows = $fund->fetchFormData(true,0,$q); $rows = $fund->fetchFromData(true,0,$q);
view::addPaginator($rows,$this->view,$this->_request); view::addPaginator($rows,$this->view,$this->_request);
return true; return true;
} }
@ -3435,7 +3435,7 @@ class Admin_DataController extends Zend_Controller_Action
$this->view->q = $q = $this->_getParam('q'); $this->view->q = $q = $this->_getParam('q');
$id = $this->_getParam('id'); $id = $this->_getParam('id');
$this->view->fund = $fund->view($id); $this->view->fund = $fund->view($id);
$rows = $fund->fetchFormData($id,0,$q); $rows = $fund->fetchFromData($id,0,$q);
view::addPaginator($rows,$this->view,$this->_request); view::addPaginator($rows,$this->view,$this->_request);
return true; return true;
} }

View File

@ -3817,9 +3817,10 @@ class AuthorController extends Zend_Controller_Action
if($ac=='index' || empty($ac)) if($ac=='index' || empty($ac))
{ {
$uuid = $this->_getParam('uuid'); $uuid = $this->_getParam('uuid');
$this->view->q=$this->_getParam('q');
if(empty($uuid)) if(empty($uuid))
{ {
$rows = $fund->fetch("",true); $rows = $fund->fetch("",true,0,$this->_getParam('q'));
view::addPaginator($rows,$this->view,$this->_request); view::addPaginator($rows,$this->view,$this->_request);
}else{ }else{
include('data/Metadata.php'); include('data/Metadata.php');
@ -3835,7 +3836,7 @@ class AuthorController extends Zend_Controller_Action
{ {
$this->_helper->viewRenderer('fund-data'); $this->_helper->viewRenderer('fund-data');
$this->view->q = $q = $this->_getParam('q'); $this->view->q = $q = $this->_getParam('q');
$rows = $fund->fetchFormData(true,$uid,$q); $rows = $fund->fetchFromData(true,$uid,$q);
view::addPaginator($rows,$this->view,$this->_request); view::addPaginator($rows,$this->view,$this->_request);
return true; return true;
} }
@ -3845,7 +3846,7 @@ class AuthorController extends Zend_Controller_Action
$this->view->q = $q = $this->_getParam('q'); $this->view->q = $q = $this->_getParam('q');
$id = $this->_getParam('id'); $id = $this->_getParam('id');
$this->view->fund = $fund->view($id); $this->view->fund = $fund->view($id);
$rows = $fund->fetchFormData($id,$q); $rows = $fund->fetchFromData($id,$uid,$q);
view::addPaginator($rows,$this->view,$this->_request); view::addPaginator($rows,$this->view,$this->_request);
return true; return true;
} }
@ -3963,6 +3964,7 @@ class AuthorController extends Zend_Controller_Action
} }
$mfid = $this->_getParam('mfid'); $mfid = $this->_getParam('mfid');
$this->view->q=$this->_getParam('q');
if(!empty($mfid)) if(!empty($mfid))
{ {
@ -3974,10 +3976,10 @@ class AuthorController extends Zend_Controller_Action
$this->view->AlertType = "alert-error"; $this->view->AlertType = "alert-error";
$this->view->error = "排序修改失败!"; $this->view->error = "排序修改失败!";
} }
$rows = $fund->fetch($uuid,true,$uid); $rows = $fund->fetch($uuid,true,0);
}else{ }else{
$this->view->ct = "ct"; $this->view->ct = "ct";
$rows = $fund->fetch($uuid,false); $rows = $fund->fetch($uuid,false,0,$this->_getParam('q'));
} }
include('data/Metadata.php'); include('data/Metadata.php');

View File

@ -95,12 +95,12 @@ class Fund extends Zend_Controller_Plugin_Abstract
} }
} }
function fetchFormData($count = true,$uid,$keyword){ function fetchFromData($count = true,$uid,$keyword){
$wheresql = array(); $wheresql = array();
if(!empty($uid) && is_int($uid)) if(!empty($uid) && is_int($uid))
{ {
$wheresql[] = " f.userid='$uid' "; $wheresql[] = " a.userid='$uid' ";
} }
if(!empty($keyword)) if(!empty($keyword))
@ -131,6 +131,7 @@ class Fund extends Zend_Controller_Plugin_Abstract
$sql = "SELECT f.*,count(md.uuid) as mds FROM ".$this->tbl_fund." f $sql = "SELECT f.*,count(md.uuid) as mds FROM ".$this->tbl_fund." f
LEFT JOIN ".$this->tbl_mdfund." mf ON mf.fid=f.id LEFT JOIN ".$this->tbl_mdfund." mf ON mf.fid=f.id
LEFT JOIN metadata md ON md.uuid=mf.uuid LEFT JOIN metadata md ON md.uuid=mf.uuid
left join mdauthor a on md.uuid=a.uuid
$wheresql $wheresql
GROUP BY f.id"; GROUP BY f.id";
@ -138,6 +139,7 @@ class Fund extends Zend_Controller_Plugin_Abstract
$sql = "SELECT mf.id as mfid,md.title as mdtitle,md.uuid FROM ".$this->tbl_fund." f $sql = "SELECT mf.id as mfid,md.title as mdtitle,md.uuid FROM ".$this->tbl_fund." f
LEFT JOIN ".$this->tbl_mdfund." mf ON mf.fid=f.id LEFT JOIN ".$this->tbl_mdfund." mf ON mf.fid=f.id
LEFT JOIN metadata md ON md.uuid=mf.uuid LEFT JOIN metadata md ON md.uuid=mf.uuid
left join mdauthor a on md.uuid=a.uuid
$wheresql $wheresql
GROUP BY md.title,md.uuid,mf.id GROUP BY md.title,md.uuid,mf.id
"; ";