示例#1
0
 public function fetch_all($ids, $force_from_db = false, $fetch_archive = 1)
 {
     $data = array();
     if (!empty($ids)) {
         if ($fetch_archive < 2) {
             $data = parent::fetch_all($ids, $force_from_db);
             if ($fetch_archive && count($data) != count($ids)) {
                 $data = $data + C::t($this->_table . '_archive')->fetch_all(array_diff($ids, array_keys($data)));
             }
         } else {
             $data = C::t($this->_table . '_archive')->fetch_all($ids);
         }
     }
     return $data;
 }
示例#2
0
 public function getPathByOrgid($orgid)
 {
     $ret = array();
     if ($org = parent::fetch($orgid)) {
         $ids = explode('-', str_replace('_', '', $org['pathkey']));
         $arr = parent::fetch_all($ids);
         foreach ($ids as $id) {
             if ($arr[$id]) {
                 $ret[] = $arr[$id]['orgname'];
             }
         }
     }
     return $ret ? implode('-', $ret) : '';
 }