Ignore max_id when it's 0 or less in BaseDepository->_selectByBoundaries

- It can cause a conflict when both min_id and max_id = 0 as default values
This commit is contained in:
Hypolite Petovan 2021-10-12 21:18:23 -04:00
parent b3c576b9ce
commit 2324dac4b2

View file

@ -87,7 +87,7 @@ abstract class BaseDepository
} }
} }
if (isset($max_id)) { if (isset($max_id) && $max_id > 0) {
$boundCondition = DBA::mergeConditions($boundCondition, ['`id` < ?', $max_id]); $boundCondition = DBA::mergeConditions($boundCondition, ['`id` < ?', $max_id]);
if (!isset($min_id) && (!isset($params['order']['id']) || $params['order']['id'] === false || $params['order']['id'] === 'ASC')) { if (!isset($min_id) && (!isset($params['order']['id']) || $params['order']['id'] === false || $params['order']['id'] === 'ASC')) {
$reverseOrder = true; $reverseOrder = true;