This commit is contained in:
2022-09-07 14:36:32 +08:00
parent c7ad5123e2
commit 9d81bc6479
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -286,7 +286,7 @@ class ActiveQuery extends Component implements ISqlBuilder
* @return bool * @return bool
* @throws * @throws
*/ */
public function batchUpdate(array $data): bool public function update(array $data): bool
{ {
$generate = $this->builder->update($data); $generate = $this->builder->update($data);
if (is_bool($generate)) { if (is_bool($generate)) {
@@ -300,7 +300,7 @@ class ActiveQuery extends Component implements ISqlBuilder
* @return bool * @return bool
* @throws * @throws
*/ */
public function batchInsert(array $data): bool public function insert(array $data): bool
{ {
[$sql, $params] = $this->builder->insert($data, TRUE); [$sql, $params] = $this->builder->insert($data, TRUE);
+1 -1
View File
@@ -68,7 +68,7 @@ class Collection extends AbstractCollection
$lists[] = $item[$primary]; $lists[] = $item[$primary];
} }
return $this->getModel()::query()->whereIn($primary, $lists) return $this->getModel()::query()->whereIn($primary, $lists)
->batchUpdate($attributes); ->update($attributes);
} }
/** /**
+2 -2
View File
@@ -192,7 +192,7 @@ class Model extends Base\Model
if (empty($data)) { if (empty($data)) {
return error('Insert data empty.', 'mysql'); 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 public static function updateAll(mixed $condition, array $attributes = []): bool
{ {
$condition = static::query()->where($condition); $condition = static::query()->where($condition);
return $condition->batchUpdate($attributes); return $condition->update($attributes);
} }