Merge pull request #1193 from conory/pr/select-limit

select 쿼리에 list_count=0 파라미터 전달시 LIMIT 해제
This commit is contained in:
conory 2019-08-30 19:54:14 +09:00 committed by GitHub
commit 5fb1352333
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 15 deletions

View file

@ -37,24 +37,25 @@ class Limit
* constructor
* @param int $list_count
* @param int $page
* @param int $page_count
* @param int $page_count
* @param int $offset
* @return void
*/
function __construct($list_count, $page = NULL, $page_count = NULL, $offset = NULL)
{
$this->list_count = $list_count;
if($page)
if($list_count->getValue())
{
$list_count_value = $list_count->getValue();
$page_value = $page->getValue();
$this->start = ($page_value - 1) * $list_count_value;
$this->page_count = $page_count;
$this->page = $page;
}
elseif($offset)
{
$this->start = $offset->getValue();
if($page && $page->getValue())
{
$this->start = ($page->getValue() - 1) * $list_count->getValue();
$this->page_count = $page_count;
$this->page = $page;
}
elseif($offset)
{
$this->start = $offset->getValue();
}
}
}
@ -86,16 +87,15 @@ class Limit
function toString()
{
if($this->page || $this->start)
if($this->start)
{
return $this->start . ' , ' . $this->list_count->getValue();
}
else
{
return $this->list_count->getValue();
return $this->list_count->getValue() ?: '';
}
}
}
/* End of file Limit.class.php */
/* Location: ./classes/db/limit/Limit.class.php */

View file

@ -602,7 +602,7 @@ class documentAdminController extends document
function deleteModuleDocument($module_srl)
{
$args = new stdClass;
$args->page = 0;
$args->list_count = 0;
$args->module_srl = intval($module_srl);
$document_list = executeQueryArray('document.getDocumentList', $args, array('document_srl'))->data;