eee
This commit is contained in:
+2
-2
@@ -181,9 +181,9 @@ class ActiveQuery extends QueryTrait implements ISqlBuilder
|
|||||||
*/
|
*/
|
||||||
public function insert(array $data): bool
|
public function insert(array $data): bool
|
||||||
{
|
{
|
||||||
[$sql, $params] = $this->builder->insert($data, isset($data[0]));
|
$sql = $this->builder->insert($data, isset($data[0]));
|
||||||
|
|
||||||
return (bool)$this->buildCommand($sql, $params)->exec();
|
return (bool)$this->buildCommand($sql)->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+2
-2
@@ -119,7 +119,7 @@ class SqlBuilder extends Component
|
|||||||
* @return array
|
* @return array
|
||||||
* @throws
|
* @throws
|
||||||
*/
|
*/
|
||||||
public function insert(array $attributes, bool $isBatch = false): array
|
public function insert(array $attributes, bool $isBatch = false): string
|
||||||
{
|
{
|
||||||
$update = 'INSERT INTO ' . $this->query->from;
|
$update = 'INSERT INTO ' . $this->query->from;
|
||||||
if ($isBatch === false) {
|
if ($isBatch === false) {
|
||||||
@@ -133,7 +133,7 @@ class SqlBuilder extends Component
|
|||||||
|
|
||||||
$keys[] = implode(',', $_keys);
|
$keys[] = implode(',', $_keys);
|
||||||
}
|
}
|
||||||
return [$update . '(' . implode('),(', $keys) . ')', $this->query->params];
|
return $update . '(' . implode('),(', $keys) . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user