Example #1
0
 /**
  * 获取数据表字段信息
  * @access public
  * @return array
  */
 public function getDbFields()
 {
     if (isset($this->options['table'])) {
         // 动态指定表名
         if (is_array($this->options['table'])) {
             $table = key($this->options['table']);
         } else {
             $table = $this->options['table'];
             if (strpos($table, ')')) {
                 // 子查询
                 return false;
             }
         }
         $fields = $this->db->getFields($table);
         return $fields ? array_keys($fields) : false;
     }
     if ($this->fields) {
         $fields = $this->fields;
         unset($fields['_type'], $fields['_pk']);
         return $fields;
     }
     return false;
 }