DataObjects/Person.php
authorAlan Knowles <alan@akbkhome.com>
Thu, 17 Nov 2011 07:38:57 +0000 (15:38 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 17 Nov 2011 07:38:57 +0000 (15:38 +0800)
DataObjects/Person.php

DataObjects/Person.php

index a46dbab..13329f2 100644 (file)
@@ -465,13 +465,10 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
             $pd->selectAdd();
             $pd->selectAdd('distinct(person_id) as person_id');
             $roled = $pd->fetchAll('person_id');
-            $this->whereAdd("
-                    join_company_id_id.comptype = 'OWNER'
-                    OR
+            $rs = $roled  ? "  OR
                     {$this->tableName()}.id IN (".implode(',', $roled) . ") 
-                    
-                    
-                    ");
+                    " : '';
+            $this->whereAdd(" join_company_id_id.comptype = 'OWNER' $rs ");
             
         }
         // -- for distribution