src/Mysqli.php
public function count($field = '')
    {

        $this->limit(1);
        if ($field) {
            $sql = 'SELECT   ' . $field . '  FROM ' . $this->table;
        } else {
            $sql = 'SELECT  COUNT(*) AS  t  FROM ' . $this->table;
        }

        if ($this->join) {
            $sql .= $this->join;
        }

        if ($this->where != '') {
            $sql .= $this->where;
        }
        if ($this->group != '') {
            $sql .= $this->group;
        }

        $result = $this->query($sql);

        $this->total = $result ? mysqli_num_rows($result) : 0;

        if ($field) {
            return (int) $this->total;
        }

        $data = mysqli_fetch_array($result, MYSQLI_NUM);

        return $data[0];
    }
public function count($field = '')
    {

        $this->limit(1);
        if ($field) {
            $sql = 'SELECT   ' . $field . '  FROM ' . $this->table;
        } else {
            $sql = 'SELECT  COUNT(*) AS  t  FROM ' . $this->table;
        }

        if ($this->join) {
            $sql .= $this->join;
        }

        if ($this->where != '') {
            $sql .= $this->where;
        }
        if ($this->group != '') {
            $sql .= $this->group;
        }

        $result = $this->query($sql);

        $this->total = $result ? mysqli_num_rows($result) : 0;

        if ($field) {
            return (int) $this->total;
        }

        $data = mysqli_fetch_array($result, MYSQLI_NUM);

        return $data[0];
    }
统计总数
@date   2017-06-14T11:09:55+0800
@author ChenMingjiang
@return [type]                   [description]