From 7ff92cd3df0422e92e832ffa8398bbdd602574cf Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 9 Jan 2013 14:53:59 +0800 Subject: [PATCH] DataObjects/Office.php --- DataObjects/Office.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/DataObjects/Office.php b/DataObjects/Office.php index 3919ac05..1206a265 100644 --- a/DataObjects/Office.php +++ b/DataObjects/Office.php @@ -30,20 +30,20 @@ class Pman_Core_DataObjects_Office extends DB_DataObject if(!empty($q['_join_country_with_person'])){ $tn = $this->tableName(); - $this->selectAdd(); - $this->selectAdd(" i18n_translate('c' , Office.country, 'en') as office_id_country_name"); +// $this->selectAdd(); +// $this->selectAdd(" i18n_translate('c' , Office.country, 'en') as office_id_country_name"); // $this->_extra_col = array('office_country_name'); // $this->_distinct= 'office_id_country&cols=office_id_country,office_id_country_name'; //then the query should be _distinct=office_id_country&cols=office_id_country,office_id_country_name -// $p = DB_DataObject::factory('Person'); -// $p->whereAdd("office_id > 0"); -// $p->selectAdd(); -// $p->selectAdd("DISTINCT(office_id) as office_id"); -// $officeIds = $p->fetchAll('office_id'); -// $this->whereAddIn($tn.'.id', $officeIds, 'INT'); -// $this->selectAdd(); -// $this->selectAdd("DISTINCT({$tn}.country) as country"); -// $this->joinAddCountryWithPerson(); + $p = DB_DataObject::factory('Person'); + $p->whereAdd("office_id > 0"); + $p->selectAdd(); + $p->selectAdd("DISTINCT(office_id) as office_id"); + $officeIds = $p->fetchAll('office_id'); + $this->whereAddIn($tn.'.id', $officeIds, 'INT'); + $this->selectAdd(); + $this->selectAdd("DISTINCT({$tn}.country) as country"); + $this->joinAddCountryWithPerson(); } } -- 2.39.2