改名
This commit is contained in:
@@ -9,9 +9,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Database;
|
||||
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Database\Traits\QueryTrait;
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Snowflake;
|
||||
|
||||
/**
|
||||
@@ -129,11 +129,12 @@ class ActiveQuery extends Component implements ISqlBuilder
|
||||
|
||||
/**
|
||||
* @param $sql
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
*/
|
||||
public function execute($sql): Command
|
||||
public function execute($sql, $params = []): Command
|
||||
{
|
||||
return $this->modelClass::getDb()->createCommand($sql);
|
||||
return $this->modelClass::getDb()->createCommand($sql, $params);
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +286,10 @@ class ActiveQuery extends Component implements ISqlBuilder
|
||||
*/
|
||||
public function batchInsert(array $data): bool
|
||||
{
|
||||
return $this->execute($this->builder->insert($data, true))->exec();
|
||||
[$sql, $params] = $this->builder->insert($data, true);
|
||||
|
||||
|
||||
return $this->execute($sql, $params)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user