diff --git a/ActiveQuery.php b/ActiveQuery.php index 55dff1e..45a0c24 100644 --- a/ActiveQuery.php +++ b/ActiveQuery.php @@ -286,7 +286,7 @@ class ActiveQuery extends Component implements ISqlBuilder * @return bool * @throws */ - public function batchUpdate(array $data): bool + public function update(array $data): bool { $generate = $this->builder->update($data); if (is_bool($generate)) { @@ -300,7 +300,7 @@ class ActiveQuery extends Component implements ISqlBuilder * @return bool * @throws */ - public function batchInsert(array $data): bool + public function insert(array $data): bool { [$sql, $params] = $this->builder->insert($data, TRUE); diff --git a/Collection.php b/Collection.php index 1764c8f..09becba 100644 --- a/Collection.php +++ b/Collection.php @@ -68,7 +68,7 @@ class Collection extends AbstractCollection $lists[] = $item[$primary]; } return $this->getModel()::query()->whereIn($primary, $lists) - ->batchUpdate($attributes); + ->update($attributes); } /** diff --git a/Model.php b/Model.php index 4b0d4b0..4385c49 100644 --- a/Model.php +++ b/Model.php @@ -192,7 +192,7 @@ class Model extends Base\Model if (empty($data)) { return error('Insert data empty.', 'mysql'); } - return static::query()->batchInsert($data); + return static::query()->insert($data); } /** @@ -226,7 +226,7 @@ class Model extends Base\Model public static function updateAll(mixed $condition, array $attributes = []): bool { $condition = static::query()->where($condition); - return $condition->batchUpdate($attributes); + return $condition->update($attributes); }