mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 03:52:15 +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.
|
// 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);
|
$result .= ' ORDER BY ' . $this->_arrangeOrderBy($this->navigation);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compose the LIMIT/OFFSET clause.
|
// 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);
|
$result .= ' LIMIT ' . $this->_arrangeLimitOffset($this->navigation);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,7 @@ class DBQueryParserTest extends \Codeception\TestCase\Test
|
||||||
$params = $query->getQueryParams();
|
$params = $query->getQueryParams();
|
||||||
|
|
||||||
$this->assertEquals('SELECT COUNT(*) AS `count` FROM (SELECT DISTINCT * FROM `rx_documents` AS `documents` ' .
|
$this->assertEquals('SELECT COUNT(*) AS `count` FROM (SELECT DISTINCT * FROM `rx_documents` AS `documents` ' .
|
||||||
'WHERE `member_srl` IN (?) AND (`regdate` >= ? OR `status` = ?) ' .
|
'WHERE `member_srl` IN (?) AND (`regdate` >= ? OR `status` = ?)) AS `subquery`', $sql);
|
||||||
'ORDER BY `list_order` ASC LIMIT 40, 20) AS `subquery`', $sql);
|
|
||||||
$this->assertEquals(['1234', '20200707120000', 'PUBLIC'], $params);
|
$this->assertEquals(['1234', '20200707120000', 'PUBLIC'], $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue