改名
This commit is contained in:
@@ -149,36 +149,7 @@ class ActiveRecord extends BaseActiveRecord
|
|||||||
}
|
}
|
||||||
return static::getDb()->createCommand()
|
return static::getDb()->createCommand()
|
||||||
->mathematics(self::getTable(), [$action => $columns], $condition)
|
->mathematics(self::getTable(), [$action => $columns], $condition)
|
||||||
->exec();
|
->exec(false, $this);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $column
|
|
||||||
* @param $value
|
|
||||||
* @param array $condition
|
|
||||||
* @return bool
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public static function incrAll($column, $value, $condition = []): bool
|
|
||||||
{
|
|
||||||
return static::getDb()->createCommand()
|
|
||||||
->mathematics(self::getTable(), [self::INCR => [$column, $value]], $condition)
|
|
||||||
->exec();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $column
|
|
||||||
* @param $value
|
|
||||||
* @param array $condition
|
|
||||||
* @return bool
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public static function decrAll($column, $value, $condition = []): bool
|
|
||||||
{
|
|
||||||
return static::getDb()->createCommand()
|
|
||||||
->mathematics(self::getTable(), [self::DECR => [$column, $value]], $condition)
|
|
||||||
->exec();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -306,12 +306,14 @@ class Command extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param null $scope
|
||||||
|
* @param bool $insert
|
||||||
* @return int|bool|array|string|null
|
* @return int|bool|array|string|null
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function exec(): int|bool|array|string|null
|
public function exec($scope = null, $insert = false): int|bool|array|string|null
|
||||||
{
|
{
|
||||||
return $this->execute(static::EXECUTE);
|
return $this->execute(static::EXECUTE, $insert, $scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user