Cml\Db\Base::lBrackets PHP Метод

lBrackets() публичный Метод

where条件增加左括号
public lBrackets ( )
    public function lBrackets()
    {
        if ($this->sql['where'] == '') {
            $this->sql['where'] = 'WHERE ';
        } else {
            if ($this->whereNeedAddAndOrOr === 1) {
                $this->sql['where'] .= ' AND ';
            } else {
                if ($this->whereNeedAddAndOrOr === 2) {
                    $this->sql['where'] .= ' OR ';
                }
            }
        }
        $this->sql['where'] .= ' (';
        //移除下一次where操作默认加上AND
        $this->whereNeedAddAndOrOr = 0;
        return $this;
    }