qqq
This commit is contained in:
@@ -286,6 +286,9 @@ class ActiveQuery extends Component implements ISqlBuilder
|
||||
*/
|
||||
public function update(array $data): bool
|
||||
{
|
||||
if (count($data) < 1) {
|
||||
return true;
|
||||
}
|
||||
$generate = $this->builder->update($data);
|
||||
if (is_bool($generate)) {
|
||||
return $generate;
|
||||
|
||||
@@ -456,6 +456,9 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
|
||||
protected function updateInternal(array $old, array $condition, array $change): bool|static
|
||||
{
|
||||
$query = static::query()->where($condition);
|
||||
if (count($change)) {
|
||||
return true;
|
||||
}
|
||||
$generate = SqlBuilder::builder($query)->update($change);
|
||||
if ($generate === false) {
|
||||
return false;
|
||||
@@ -579,6 +582,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
|
||||
|
||||
/**
|
||||
* @return Relation|null
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function getRelation(): ?Relation
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user