src/Mysqli.php
public function find($value = '', $isArray = false)
    {

        if (!$this->table) {
            throw new Exception('请选择数据表');
        }

        if (!$this->limit && $value != 'array' && !$isArray) {
            $this->limit(1);
        }

        $this->_sql = 'SELECT ' . $this->field . ' FROM ' . $this->table;

        empty($this->join) ?: $this->_sql .= $this->join;
        empty($this->where) ?: $this->_sql .= $this->where;
        empty($this->group) ?: $this->_sql .= $this->group;
        empty($this->having) ?: $this->_sql .= $this->having;
        empty($this->order) ?: $this->_sql .= $this->order;
        empty($this->limit) ?: $this->_sql .= $this->limit;

        //开启子查询直接返回sql
        if ($this->chilidSql) {
            return $this->_sql;
        }

        $result = $this->query();
        if (!$result) {
            throw new Exception('查询sql错误:' . $this->_sql);
        }

        //获取记录条数
        $this->total = mysqli_num_rows($result);
        if ($this->total == 0) {
            if ($value == 'array') {
                return array();
            } elseif ($value == 'one' && !$isArray) {
                return null;
            } elseif ($value == 'one' && $isArray) {
                return array();
            } else {
                return '';
            }
        }

        //单个字段模式
        if ($value == 'one' && !$isArray) {
            $row = mysqli_fetch_array($result, MYSQLI_NUM);
            if (empty($row)) {
                return null;
            }

            return $row[0];
        }
        //单字段数组模式
        elseif ($value == 'one' && $isArray) {
            while ($row = mysqli_fetch_array($result, MYSQLI_NUM)) {
                $this->field = str_replace('`', '', $this->field);

                $isArray !== true ? $data[$row[1]] = $row[0] : $data[] = $row[0];
            }

            if (empty($data)) {
                return array();
            }

            return $data;
        }
        //三维数组模式
        elseif ($this->total > 1 || $value == 'array') {

            while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
                $data[] = $row;
            }

            for ($i = 0, $n = count($data); $i < $n; $i++) {
                if (is_array($data[$i])) {
                    foreach ($data[$i] as $key => $value) {
                        $datas[$i][$key] = $value;
                    }
                }
            }

            return $datas;
        }
        //二维数组模式
        else {
            $row = mysqli_fetch_array($result, MYSQLI_ASSOC);

            foreach ($row as $key => $value) {
                $data[$key] = $value;
            }

            return $data;
        }
    }
public function find($value = '', $isArray = false)
    {

        if (!$this->table) {
            throw new Exception('请选择数据表');
        }

        if (!$this->limit && $value != 'array' && !$isArray) {
            $this->limit(1);
        }

        $this->_sql = 'SELECT ' . $this->field . ' FROM ' . $this->table;

        empty($this->join) ?: $this->_sql .= $this->join;
        empty($this->where) ?: $this->_sql .= $this->where;
        empty($this->group) ?: $this->_sql .= $this->group;
        empty($this->having) ?: $this->_sql .= $this->having;
        empty($this->order) ?: $this->_sql .= $this->order;
        empty($this->limit) ?: $this->_sql .= $this->limit;

        //开启子查询直接返回sql
        if ($this->chilidSql) {
            return $this->_sql;
        }

        $result = $this->query();
        if (!$result) {
            throw new Exception('查询sql错误:' . $this->_sql);
        }

        //获取记录条数
        $this->total = mysqli_num_rows($result);
        if ($this->total == 0) {
            if ($value == 'array') {
                return array();
            } elseif ($value == 'one' && !$isArray) {
                return null;
            } elseif ($value == 'one' && $isArray) {
                return array();
            } else {
                return '';
            }
        }

        //单个字段模式
        if ($value == 'one' && !$isArray) {
            $row = mysqli_fetch_array($result, MYSQLI_NUM);
            if (empty($row)) {
                return null;
            }

            return $row[0];
        }
        //单字段数组模式
        elseif ($value == 'one' && $isArray) {
            while ($row = mysqli_fetch_array($result, MYSQLI_NUM)) {
                $this->field = str_replace('`', '', $this->field);

                $isArray !== true ? $data[$row[1]] = $row[0] : $data[] = $row[0];
            }

            if (empty($data)) {
                return array();
            }

            return $data;
        }
        //三维数组模式
        elseif ($this->total > 1 || $value == 'array') {

            while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
                $data[] = $row;
            }

            for ($i = 0, $n = count($data); $i < $n; $i++) {
                if (is_array($data[$i])) {
                    foreach ($data[$i] as $key => $value) {
                        $datas[$i][$key] = $value;
                    }
                }
            }

            return $datas;
        }
        //二维数组模式
        else {
            $row = mysqli_fetch_array($result, MYSQLI_ASSOC);

            foreach ($row as $key => $value) {
                $data[$key] = $value;
            }

            return $data;
        }
    }
查询单条/多条信息
@date   2017-11-22T00:35:19+0800
@author ChenMingjiang
@param  string                   $value   [array:查询数据 one:查询单条单个字段内容]
@param  boolean                  $isArray [单字段 数组模式]
@param  boolean                  $chilid  [子查询]
@return [type]                            [description]