Commit 2e01c06a by Qiang Xue

Fixes #865.

parent 590121c4
...@@ -912,11 +912,6 @@ class QueryBuilder extends \yii\base\Object ...@@ -912,11 +912,6 @@ class QueryBuilder extends \yii\base\Object
protected function buildCompositeInCondition($operator, $columns, $values, &$params) protected function buildCompositeInCondition($operator, $columns, $values, &$params)
{ {
foreach ($columns as $i => $column) {
if (strpos($column, '(') === false) {
$columns[$i] = $this->db->quoteColumnName($column);
}
}
$vss = array(); $vss = array();
foreach ($values as $value) { foreach ($values as $value) {
$vs = array(); $vs = array();
...@@ -931,6 +926,11 @@ class QueryBuilder extends \yii\base\Object ...@@ -931,6 +926,11 @@ class QueryBuilder extends \yii\base\Object
} }
$vss[] = '(' . implode(', ', $vs) . ')'; $vss[] = '(' . implode(', ', $vs) . ')';
} }
foreach ($columns as $i => $column) {
if (strpos($column, '(') === false) {
$columns[$i] = $this->db->quoteColumnName($column);
}
}
return '(' . implode(', ', $columns) . ") $operator (" . implode(', ', $vss) . ')'; return '(' . implode(', ', $columns) . ") $operator (" . implode(', ', $vss) . ')';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment