变更
This commit is contained in:
+2
-2
@@ -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
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user