lib/components/db/ActiveQuery.php
protected function buildLogic($field, $operator, $value = null)
    {
        $operatorMap = [
            'equal' => '=',
            'not_equal' => '!=',
            'less' => '<',
            'less_or_equal' => '<=',
            'greater' => '>',
            'greater_or_equal' => '>=',

        ];
        switch ($operator) {
            case 'equal':
                return ['or like', $field, $value, false];
            break;
            case 'not_equal':
                return ['or not like', $field, $value, false];
            break;
            case 'begins_with':
                return ['like', $field, $value . '%', false];
            break;
            case 'not_begins_with':
                return ['not like', $field, $value . '%', false];
            break;
            case 'contains':
                return ['like', $field, '%' . $value . '%', false];
            case 'not_contains':
                return ['not like', $field, '%' . $value . '%', false];
            break;
            case 'ends_with':
                return ['like', $field, '%' . $value, false];
            break;
            case 'not_ends_with':
                return ['not like', $field, '%' . $value, false];
            break;
            case 'less':
            case 'less_or_equal':
            case 'greater':
            case 'greater_or_equal':
                $paramName = ':' . md5(serialize([microtime(true), mt_rand(), $value]));
                $this->addParams([$paramName => $value]);

                return $field . $operatorMap[$operator] . $paramName;
            break;
            case 'in':
                $value = strtr($value, ', ', ',');

                return $this->buildLogic($field, 'equal', explode(",", $value));
            break;
            case 'not_in':
                $value = strtr($value, ', ', ',');

                return $this->buildLogic($field, 'not_equal', explode(",", $value));
            break;
            case 'is_empty':
                return $field . '=""';
            break;
            case 'is_not_empty':
                return $field . '!=""';
            break;
            case 'is_null':
                return $field . ' IS NULL';
            break;
            case 'is_not_null':
                return $field . ' IS NOT NULL';
            break;
        }

        return false;
    }
protected function buildLogic($field, $operator, $value = null)
    {
        $operatorMap = [
            'equal' => '=',
            'not_equal' => '!=',
            'less' => '<',
            'less_or_equal' => '<=',
            'greater' => '>',
            'greater_or_equal' => '>=',

        ];
        switch ($operator) {
            case 'equal':
                return ['or like', $field, $value, false];
            break;
            case 'not_equal':
                return ['or not like', $field, $value, false];
            break;
            case 'begins_with':
                return ['like', $field, $value . '%', false];
            break;
            case 'not_begins_with':
                return ['not like', $field, $value . '%', false];
            break;
            case 'contains':
                return ['like', $field, '%' . $value . '%', false];
            case 'not_contains':
                return ['not like', $field, '%' . $value . '%', false];
            break;
            case 'ends_with':
                return ['like', $field, '%' . $value, false];
            break;
            case 'not_ends_with':
                return ['not like', $field, '%' . $value, false];
            break;
            case 'less':
            case 'less_or_equal':
            case 'greater':
            case 'greater_or_equal':
                $paramName = ':' . md5(serialize([microtime(true), mt_rand(), $value]));
                $this->addParams([$paramName => $value]);

                return $field . $operatorMap[$operator] . $paramName;
            break;
            case 'in':
                $value = strtr($value, ', ', ',');

                return $this->buildLogic($field, 'equal', explode(",", $value));
            break;
            case 'not_in':
                $value = strtr($value, ', ', ',');

                return $this->buildLogic($field, 'not_equal', explode(",", $value));
            break;
            case 'is_empty':
                return $field . '=""';
            break;
            case 'is_not_empty':
                return $field . '!=""';
            break;
            case 'is_null':
                return $field . ' IS NULL';
            break;
            case 'is_not_null':
                return $field . ' IS NOT NULL';
            break;
        }

        return false;
    }
[[@doctodo method_description:buildLogic]].

@param [[@doctodo param_type:field]]    $field    [[@doctodo param_description:field]]
@param [[@doctodo param_type:operator]] $operator [[@doctodo param_description:operator]]
@param [[@doctodo param_type:value]]    $value    [[@doctodo param_description:value]] [optional]

@return [[@doctodo return_type:buildLogic]] [[@doctodo return_description:buildLogic]]