Browse Source

Merge remote-tracking branch 'refs/remotes/origin/master'

tags/2.0.0-beta
Alexander Makarov 12 years ago
parent
commit
066734ccf4
  1. 6
      framework/db/QueryBuilder.php

6
framework/db/QueryBuilder.php

@ -592,11 +592,11 @@ class QueryBuilder extends \yii\base\Object
return $operator === 'IN' ? '0=1' : ''; return $operator === 'IN' ? '0=1' : '';
} }
if (is_array($column)) {
if (count($column) > 1) { if (count($column) > 1) {
return $this->buildCompositeInCondition($operator, $column, $values); return $this->buildCompositeInCondition($operator, $column, $values);
} else { } elseif (is_array($column)) {
$column = reset($column); $column = reset($column);
}
foreach ($values as $i => $value) { foreach ($values as $i => $value) {
if (is_array($value)) { if (is_array($value)) {
$value = isset($value[$column]) ? $value[$column] : null; $value = isset($value[$column]) ? $value[$column] : null;
@ -607,8 +607,6 @@ class QueryBuilder extends \yii\base\Object
$values[$i] = is_string($value) ? $this->db->quoteValue($value) : (string)$value; $values[$i] = is_string($value) ? $this->db->quoteValue($value) : (string)$value;
} }
} }
}
}
if (strpos($column, '(') === false) { if (strpos($column, '(') === false) {
$column = $this->db->quoteColumnName($column); $column = $this->db->quoteColumnName($column);
} }

Loading…
Cancel
Save