Add a criteria item to the filter.
@param  string   $field
@param  string   $operator
@param  mixed    $value
@return self
342058
protected function addCriteria( $field, $operator, $value ) {

		$field = trim($field);

		if( !isset($this->criteria[$field]) )
			$this->criteria[$field] = [];

		$this->criteria[$field][$operator] = $value;

		return $this;

	}
452267
public function where($field, $op = null, $value = null) {
        return $this->_modifyPredicate($this->_where, Predicate::ALSO, $field, $op, $value);
    }
114499
public function whereInfix($field, $operator = '=', $condition = false)
    {
        $numArgs = func_num_args();
        if ($numArgs > 2) {
            $this->where->addCondition($field, $condition, $operator);
        } elseif ($numArgs == 2) {
            $this->where->addCondition($field, $operator, '=');
        } else {
            $this->where->addCondition($field);
        }

        return $this;
    }
144131
public function condition($field, $value = NULL, $expressionOperator = NULL)
    {

        if (!isset($expressionOperator)) {
            if (is_array($value)) {
                $expressionOperator = 'IN';
            }
            else {
                $expressionOperator = '=';
            }
        }
        $this->conditions[] = array(
            'field' => $field,
            'value' => $value,
            'operator' => $expressionOperator,
        );
        return $this;
    }
286630
public function addFilter($field, $value, $operator)
    {
        if ((is_numeric($field) || !empty($field)) && (!empty($value) || $value == '0')) {
            if (!is_null($operator)) {
                $this->filters[$field][$operator] = $value;
            } else {
                $this->filters[$field] = $value;
            }
        }

        return $this;
    }
778298
public function where($field, $op, $value)
    {
        $this->pending['where'][] = array(
            'type'  => 'and',
            'field' => $field,
            'op'    => $op,
            'value' => $value,
        );

        return $this;
    }
261196
public static function expr($field, $operator = null, $value = null) {
        return new Expr($field, $operator, $value);
    }
1041331
public function whereRaw($field, $operator = null, $value = null)
    {
        return $this->where($field, $operator, $value, 'and', true);
    }
32007
public function orWhere(string $key, string $operator, $value): QueryBuilder
    {
        $this->addWhere($key, $operator, $value, 'OR');
        return $this;
    }
749964
public function where($field, $operator, $value = null)
    {
        if (is_null($value)) {
            $value    = $operator;
            $operator = '=';
        }

        return $this->filter(function ($data) use ($field, $operator, $value) {
            if (strpos($field, '.')) {
                list($field, $relation) = explode('.', $field);

                $result = isset($data[$field][$relation]) ? $data[$field][$relation] : null;
            } else {
                $result = isset($data[$field]) ? $data[$field] : null;
            }

            switch ($operator) {
                case '===':
                    return $result === $value;
                case '!==':
                    return $result !== $value;
                case '!=':
                case '<>':
                    return $result != $value;
                case '>':
                    return $result > $value;
                case '>=':
                    return $result >= $value;
                case '<':
                    return $result < $value;
                case '<=':
                    return $result <= $value;
                case 'like':
                    return is_string($result) && false !== strpos($result, $value);
                case 'not like':
                    return is_string($result) && false === strpos($result, $value);
                case 'in':
                    return is_scalar($result) && in_array($result, $value, true);
                case 'not in':
                    return is_scalar($result) && !in_array($result, $value, true);
                case 'between':
                    list($min, $max) = is_string($value) ? explode(',', $value) : $value;
                    return is_scalar($result) && $result >= $min && $result <= $max;
                case 'not between':
                    list($min, $max) = is_string($value) ? explode(',', $value) : $value;
                    return is_scalar($result) && $result > $max || $result < $min;
                case '==':
                case '=':
                default:
                    return $result == $value;
            }
        });
    }
1318517
public function having(string $key, string $operator, $value): SelectQueryBuilder
    {
        $this->addHaving($key, $operator, $value, 'AND');
        return $this;
    }
485227
public function create($operator, $value)
    {
        $this->operator = $operator;
        $this->value    = $value;

        return $this;
    }
450916
public function addAnd($value , $operator = null) {
        
        $param = new self();
        $param->setOperator($this->setDefaultOperator($operator))->setValue($value);
        $this->and[] = $param;
        return $this;
    }
1181328
public function where($field, $operator = null, $value = null)
    {
        return $this->andWhere($field, $operator, $value);
    }
47129
public function in($field, $value) {
        $this->add($field, Expr::IN, (array) $value);

        return $this;
    }
685617
public function addCriteria($criteria = null, $operator = 'AND')
    {
        if ($criteria instanceof Criteria) {
            $query = $criteria->getQuery();
            // 添加 WHERE 条件
            isset($query['where']) && $this->addWhere($query['where'], $criteria->getParams(), $operator);
        }
        return $this;
    }
370584
public function setOperator($operator)
    {
        if (! array_key_exists($operator, $this->sqlOperators)) {
            throw new FilterOperatorException("Operator [$operator] not found");
        }

        $this->operator = $operator;

        return $this;
    }