mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Fix count error when searching by extra_vars
https://xetown.com/questions/1519425
This commit is contained in:
parent
6b0ef1f468
commit
800f323b9c
2 changed files with 3 additions and 4 deletions
|
|
@ -232,13 +232,13 @@ class Query extends VariableBase
|
|||
}
|
||||
|
||||
// Compose the ORDER BY clause.
|
||||
if ($this->navigation && count($this->navigation->orderby) && ($count_only != 1 || $count_wrap))
|
||||
if ($this->navigation && count($this->navigation->orderby) && !$count_only)
|
||||
{
|
||||
$result .= ' ORDER BY ' . $this->_arrangeOrderBy($this->navigation);
|
||||
}
|
||||
|
||||
// Compose the LIMIT/OFFSET clause.
|
||||
if ($this->navigation && $this->navigation->list_count && ($count_only != 1 || $count_wrap))
|
||||
if ($this->navigation && $this->navigation->list_count && !$count_only)
|
||||
{
|
||||
$result .= ' LIMIT ' . $this->_arrangeLimitOffset($this->navigation);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,8 +61,7 @@ class DBQueryParserTest extends \Codeception\TestCase\Test
|
|||
$params = $query->getQueryParams();
|
||||
|
||||
$this->assertEquals('SELECT COUNT(*) AS `count` FROM (SELECT DISTINCT * FROM `rx_documents` AS `documents` ' .
|
||||
'WHERE `member_srl` IN (?) AND (`regdate` >= ? OR `status` = ?) ' .
|
||||
'ORDER BY `list_order` ASC LIMIT 40, 20) AS `subquery`', $sql);
|
||||
'WHERE `member_srl` IN (?) AND (`regdate` >= ? OR `status` = ?)) AS `subquery`', $sql);
|
||||
$this->assertEquals(['1234', '20200707120000', 'PUBLIC'], $params);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue