From ca134096738c17bb6e88786965af728cb7f2432a Mon Sep 17 00:00:00 2001 From: wlx Date: Tue, 28 May 2013 05:36:26 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=94=AF=E6=8C=81=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/DataController.php | 4 ++-- .../default/controllers/AuthorController.php | 18 ++++++++++-------- application/models/data/Fund.php | 10 ++++++---- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index d7141c4d..ccb4f9ef 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -3424,7 +3424,7 @@ class Admin_DataController extends Zend_Controller_Action { $this->_helper->viewRenderer('fund-data-list'); $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); return true; } @@ -3435,7 +3435,7 @@ class Admin_DataController extends Zend_Controller_Action $this->view->q = $q = $this->_getParam('q'); $id = $this->_getParam('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); return true; } diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index 16cbb0e9..f1c0de4e 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -3816,10 +3816,11 @@ class AuthorController extends Zend_Controller_Action if($ac=='index' || empty($ac)) { - $uuid = $this->_getParam('uuid'); + $uuid = $this->_getParam('uuid'); + $this->view->q=$this->_getParam('q'); if(empty($uuid)) { - $rows = $fund->fetch("",true); + $rows = $fund->fetch("",true,0,$this->_getParam('q')); view::addPaginator($rows,$this->view,$this->_request); }else{ include('data/Metadata.php'); @@ -3835,7 +3836,7 @@ class AuthorController extends Zend_Controller_Action { $this->_helper->viewRenderer('fund-data'); $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); return true; } @@ -3845,7 +3846,7 @@ class AuthorController extends Zend_Controller_Action $this->view->q = $q = $this->_getParam('q'); $id = $this->_getParam('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); return true; } @@ -3962,7 +3963,8 @@ class AuthorController extends Zend_Controller_Action } } - $mfid = $this->_getParam('mfid'); + $mfid = $this->_getParam('mfid'); + $this->view->q=$this->_getParam('q'); if(!empty($mfid)) { @@ -3974,10 +3976,10 @@ class AuthorController extends Zend_Controller_Action $this->view->AlertType = "alert-error"; $this->view->error = "排序修改失败!"; } - $rows = $fund->fetch($uuid,true,$uid); + $rows = $fund->fetch($uuid,true,0); }else{ - $this->view->ct = "ct"; - $rows = $fund->fetch($uuid,false); + $this->view->ct = "ct"; + $rows = $fund->fetch($uuid,false,0,$this->_getParam('q')); } include('data/Metadata.php'); diff --git a/application/models/data/Fund.php b/application/models/data/Fund.php index 6d37d2a0..e0db52e8 100644 --- a/application/models/data/Fund.php +++ b/application/models/data/Fund.php @@ -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(); if(!empty($uid) && is_int($uid)) { - $wheresql[] = " f.userid='$uid' "; + $wheresql[] = " a.userid='$uid' "; } if(!empty($keyword)) @@ -130,14 +130,16 @@ class Fund extends Zend_Controller_Plugin_Abstract { $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 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 GROUP BY f.id"; }else{ $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 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 GROUP BY md.title,md.uuid,mf.id ";