src/db/BuildSql.php
public function where($where, $value = null, $exp = null)
    {

        if (!$where) {
            return $this;
        }

        // 存在三个参数 $exp => 参数值
        if ($value !== null && $exp !== null) {
            $map[$where] = [$value, $exp];
            $where       = $map;

        }
        // 存在两个参数
        elseif ($value !== null && $exp === null) {

            if (is_array($value)) {
                throw new Exception("SQL Where 参数值错误 {$where} = `数组`");
            }

            $map[$where] = $value;
            $where       = $map;
        }

        // 批量处理数组
        if (is_array($where)) {
            foreach ($where as $mapField => $v) {

                // 格式化字段
                $mapField = $this->addFieldTag($mapField);

                if (is_array($v)) {
                    list($mapExp, $mapValue) = $v;
                } elseif ($mapField == '_string') {
                    $mapExp   = '_string';
                    $mapValue = $v;
                } else {
                    $mapExp   = '=';
                    $mapValue = $v;
                }

                // 解析map
                $this->options['map'][] = $whereMap[] = $this->parseMap($mapField, $mapExp, $mapValue);
            }

            $newWhere = $this->parseWhere($whereMap);

        }
        // 单条where语句
        else {
            //记录条件参数
            $this->options['map'][] = $where;
        }

        if (!empty($newWhere)) {
            if (!isset($this->bulid['where'])) {
                $this->bulid['where'] = ' WHERE ' . substr($newWhere, 5);
            } else {
                $this->bulid['where'] .= $newWhere;
            }
        }

        return $this;
    }
public function where($where, $value = null, $exp = null)
    {

        if (!$where) {
            return $this;
        }

        // 存在三个参数 $exp => 参数值
        if ($value !== null && $exp !== null) {
            $map[$where] = [$value, $exp];
            $where       = $map;

        }
        // 存在两个参数
        elseif ($value !== null && $exp === null) {

            if (is_array($value)) {
                throw new Exception("SQL Where 参数值错误 {$where} = `数组`");
            }

            $map[$where] = $value;
            $where       = $map;
        }

        // 批量处理数组
        if (is_array($where)) {
            foreach ($where as $mapField => $v) {

                // 格式化字段
                $mapField = $this->addFieldTag($mapField);

                if (is_array($v)) {
                    list($mapExp, $mapValue) = $v;
                } elseif ($mapField == '_string') {
                    $mapExp   = '_string';
                    $mapValue = $v;
                } else {
                    $mapExp   = '=';
                    $mapValue = $v;
                }

                // 解析map
                $this->options['map'][] = $whereMap[] = $this->parseMap($mapField, $mapExp, $mapValue);
            }

            $newWhere = $this->parseWhere($whereMap);

        }
        // 单条where语句
        else {
            //记录条件参数
            $this->options['map'][] = $where;
        }

        if (!empty($newWhere)) {
            if (!isset($this->bulid['where'])) {
                $this->bulid['where'] = ' WHERE ' . substr($newWhere, 5);
            } else {
                $this->bulid['where'] .= $newWhere;
            }
        }

        return $this;
    }
查询条件
@date   2018-06-29T15:50:51+0800
@author ChenMingjiang
@param  [type]                   $where [description]
@param  [type]                   $value [description]
@param  [type]                   $exp   [description]
@return [type]                          [description]