Issue 667: 게시판 목록 가져오는 쿼리의 검토 필요

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9737 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-10-25 16:11:24 +00:00
parent 2e87a9461f
commit 0c5f501692
2 changed files with 114 additions and 115 deletions

View file

@ -585,16 +585,24 @@
* a method, navigation, is used
**/
function _executeSelectAct($queryObject, $connection = null){
$query = $this->getSelectSql($queryObject);
if(is_a($query, 'Object')) return;
$limit = $queryObject->getLimit();
if ($limit && $limit->isPageHandler())
return $this->queryPageLimit($queryObject, $result, $connection);
else {
$query = $this->getSelectSql($queryObject);
if(is_a($query, 'Object')) return;
$query .= (__DEBUG_QUERY__&1 && $queryObject->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):'';
$result = $this->_query ($query, $connection);
$query .= (__DEBUG_QUERY__&1 && $queryObject->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):'';
$result = $this->_query ($query, $connection);
if ($this->isError ())
return $this->queryError($queryObject);
else
return $this->queryPageLimit($queryObject, $result, $connection);
if ($this->isError ())
return $this->queryError($queryObject);
$data = $this->_fetch($result);
$buff = new Object ();
$buff->data = $data;
return $buff;
}
}
function queryError($queryObject){
@ -612,9 +620,6 @@
}
function queryPageLimit($queryObject, $result, $connection){
$limit = $queryObject->getLimit();
if ($limit && $limit->isPageHandler()) {
// Total count
$temp_where = $queryObject->getWhereString(true, false);
$count_query = sprintf('select count(*) as "count" %s %s', 'FROM ' . $queryObject->getFromString(), ($temp_where === '' ? '' : ' WHERE '. $temp_where));
@ -661,11 +666,6 @@
$buff->page = $page;
$buff->data = $data;
$buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count);
}else{
$data = $this->_fetch($result);
$buff = new Object ();
$buff->data = $data;
}
return $buff;
}