[comment]: # translation:outdated

[comment]: # ({fde2c9b2-fde2c9b2})
# report.update

[comment]: # ({/fde2c9b2-fde2c9b2})

[comment]: # ({4abe9d67-3aeb5e9e})
### 描述

`object report.update(object/array reports)`

此方法允许update现有的定时报告.

::: noteclassic
此方法仅适用于*管理员*和*超级管理员*
用户类型. 调用该方法的权限可在用户角色
设置中撤销. 更多信息请参阅[User
roles](/manual/web_interface/frontend_sections/users/user_roles)

:::

[comment]: # ({/4abe9d67-3aeb5e9e})

[comment]: # ({29b5f30e-e2e33f61})
### 参数

`(object/array)` 待更新的定时报告属性。

`reportid` 属性必须为每个定时报告定义，所有其他属性均为可选。仅传递的属性会被更新，其余属性将保持不变。

除了[报告](object#报告)外，该方法还接受以下参数。

| 参数 | [数据类型](/manual/api/reference_commentary#数据类型) | 描述 |
|--|--|------|
| users | object/array | [用户](object#用户) 用于替换当前分配给定时报告的用户。<br><br>[参数行为](/manual/api/reference_commentary#参数行为):<br>- *必需* 如果未设置 `user_groups` |
| user\_groups | object/array | [用户组](object#用户组) 用于替换当前分配给定时报告的用户组。<br><br>[参数行为](/manual/api/reference_commentary#参数行为):<br>- *必需* 如果未设置 `users` |

[comment]: # ({/29b5f30e-e2e33f61})

[comment]: # ({de75bc91-de75bc91})
### 返回值

`(object)` 返回一个object，其中包含已更新计划报告的ID，这些ID位于`reportids`属性下。

[comment]: # ({/de75bc91-de75bc91})

[comment]: # ({b41637d2-b41637d2})
### 示例

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({b38759b3-3f9e0b32})
#### 禁用定时报告

[执行请求](/manual/api#执行请求):

```json
{
    "jsonrpc": "2.0",
    "method": "report.update",
    "params": {
        "reportid": "1",
        "status": "0"
    },
    "id": 1
}
```
响应:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "reportids": [
            "1"
        ]
    },
    "id": 1
}
```

[comment]: # ({/b38759b3-3f9e0b32})

[comment]: # ({c52572c8-c52572c8})
### 另请参阅

-   [用户](object#用户)
-   [用户组](object#用户组)

[comment]: # ({/c52572c8-c52572c8})

[comment]: # ({74d81ce5-74d81ce5})
### 来源

CReport::update() 位于 *ui/include/classes/api/services/CReport.php* 文件中.

[comment]: # ({/74d81ce5-74d81ce5})
