mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 06:37:55 +08:00 
			
		
		
		
	fixed broken NOT condition in elasticsearch
This commit is contained in:
		@ -227,7 +227,7 @@ class QueryBuilder extends \yii\base\Object
 | 
				
			|||||||
        return count($parts) === 1 ? $parts[0] : ['and' => $parts];
 | 
					        return count($parts) === 1 ? $parts[0] : ['and' => $parts];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private function buildNotCondition($operator, $operands, &$params)
 | 
					    private function buildNotCondition($operator, $operands)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (count($operands) != 1) {
 | 
					        if (count($operands) != 1) {
 | 
				
			||||||
            throw new InvalidParamException("Operator '$operator' requires exactly one operand.");
 | 
					            throw new InvalidParamException("Operator '$operator' requires exactly one operand.");
 | 
				
			||||||
@ -235,7 +235,7 @@ class QueryBuilder extends \yii\base\Object
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        $operand = reset($operands);
 | 
					        $operand = reset($operands);
 | 
				
			||||||
        if (is_array($operand)) {
 | 
					        if (is_array($operand)) {
 | 
				
			||||||
            $operand = $this->buildCondition($operand, $params);
 | 
					            $operand = $this->buildCondition($operand);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return [$operator => $operand];
 | 
					        return [$operator => $operand];
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user