From ae5ee4f99d241a83fe36ae78968730027a5ffda6 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 11 Nov 2010 19:16:38 +0800 Subject: [PATCH] Pman/Roo.php --- Pman/Roo.php | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/Pman/Roo.php b/Pman/Roo.php index 7766e83..b069b44 100644 --- a/Pman/Roo.php +++ b/Pman/Roo.php @@ -153,29 +153,16 @@ class Pman_Roo extends Pman $this->jerr("PERMISSION DENIED"); } - $map = $this->loadMap($x, $_columns, empty($_REQUEST['_distinct']) ? false: $_REQUEST['_distinct']); + // sets map and countWhat + $this->loadMap($x, $_columns, empty($_REQUEST['_distinct']) ? false: $_REQUEST['_distinct']); $this->setFilters($x,$_REQUEST); // build join if req. - $countWhat = false; - if (!empty($_REQUEST['_distinct'])) { - $cols = $x->table(); - // print_r($cols); - - if (isset($cols[$_REQUEST['_distinct']])) { - $countWhat = 'distinct ' . $_REQUEST['_distinct']; - $x->selectAdd(); - $x->selectAdd('distinct('.$_REQUEST['_distinct'].')'); - $_columns = array( $_REQUEST['_distinct'] ); - } else { - $this->jerr('invalid distinct'); - } - - } - $total = $x->count($countWhat); + + $total = $x->count($this->countWhat); // sorting.. // DB_DataObject::debugLevel(1); -- 2.39.2