From 642b9098be9bc8155334cafd0d8b7d6c0d120cf4 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 2 Dec 2020 14:52:25 +0800 Subject: [PATCH] pdo fix as _query is private --- Pman/Roo.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Pman/Roo.php b/Pman/Roo.php index 4dfffb1..6363917 100644 --- a/Pman/Roo.php +++ b/Pman/Roo.php @@ -260,8 +260,13 @@ class Pman_Roo extends Pman //DB_DataObject::debugLevel(1); // count with multiple joins and no conditions can be quite slow - so if there are no conditions - just remove the joins from the count. $xx = clone($x); - if (empty($xx->_query['condition']) && !empty($xx->_join)) { + $old_where = $x->whereAdd(); + if (empty($old_where )) { $xx->_join = ''; + } else { + $x->whereAdd($old_where); + $xx=clone($x); + } $total = $xx->count($this->countWhat); -- 2.39.2