src/db/BuildSql.php
public function getField($field = 'COLUMN_NAME')
    {
        $this->field($field);
        $where = ' WHERE table_name = \'' . $this->bulid['table'] . '\'';
        if ($this->bulid['group']) {
            $where .= $this->bulid['group'];
        }

        $this->bulid['sql'] = 'SELECT ' . $this->bulid['field'] . ' from information_schema.columns ' . $where;
        $result             = $this->query();
        $list               = $result->fetchAll(PDO::FETCH_ASSOC);

        if (count($this->options['field']) == 1) {
            foreach ($list as $key => $value) {
                $data[] = $value[$field];
            }
        } else {
            $data = $list;
        }

        return $data;
    }
public function getField($field = 'COLUMN_NAME')
    {
        $this->field($field);
        $where = ' WHERE table_name = \'' . $this->bulid['table'] . '\'';
        if ($this->bulid['group']) {
            $where .= $this->bulid['group'];
        }

        $this->bulid['sql'] = 'SELECT ' . $this->bulid['field'] . ' from information_schema.columns ' . $where;
        $result             = $this->query();
        $list               = $result->fetchAll(PDO::FETCH_ASSOC);

        if (count($this->options['field']) == 1) {
            foreach ($list as $key => $value) {
                $data[] = $value[$field];
            }
        } else {
            $data = $list;
        }

        return $data;
    }
查询表字段名